Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for module-path on remote #1

Open
Adito5393 opened this issue Apr 12, 2021 · 3 comments
Open

Support for module-path on remote #1

Adito5393 opened this issue Apr 12, 2021 · 3 comments
Assignees

Comments

@Adito5393
Copy link
Contributor

Great job in offering a template project for a really fast setup and starting point. However, I see that the antrun is setup to run using the classpath and -jar command.

Is it possible to offer the user the option to run using the module-path? Is the debugging mode still running fine?

I remember I tried to setup the nbactions.xml to use the module-path to debug using exec-maven-plugin, and I failed:

 <action>
            <actionName>debug</actionName>
            <packagings>
                <packaging>jar</packaging>
            </packagings>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:exec</goal>
            </goals>
            <properties>
                 <!-- <exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath groupID.package.App</exec.args> -->
                <!-- Run as a module (WIP - currently fails to find current module)): -->
                <exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -p %modulepath -m moduleName/groupID.package.App</exec.args>
                <exec.executable>java</exec.executable>
                <jpda.listen>true</jpda.listen>
            </properties>
</action>
@Adito5393
Copy link
Contributor Author

I have managed to run the debugger in modulepath mode also, had to incl the copy-dependencies goal:

<action>
            <actionName>debug</actionName>
            <packagings>
                <packaging>jar</packaging>
            </packagings>
            <goals>
                <goal>process-classes</goal>
                <goal>package</goal>
                <goal>org.apache.maven.plugins:maven-dependency-plugin:copy-dependencies</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:exec</goal>
            </goals>
            <properties>
                <exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -p "${project.build.directory}/dependencies" -m moduleName/groupID.package.App</exec.args> 
                <exec.executable>java</exec.executable>
                <jpda.listen>true</jpda.listen>
            </properties>
</action>

I have forked the repo, but I think it will be better to have a new repo for handling the module-info.java file.

We could include this feature in this repo if we can export a file based on the user input!

In the archetype-metadata.xml I could add a new property:

<requiredProperty key="useModuleInfo" >
	<defaultValue>true</defaultValue>
	<validationRegex>^(?i)(true|false)$</validationRegex>
</requiredProperty>

But then, I will include the module-info in a fileSet, but it should be extracted based on the useModuleInfo value. Any ideas on how to do that?

@Adito5393
Copy link
Contributor Author

I found out that we could write a Post-generation script to delete the module-info file if user doesn't want it.

I will try to implement a solution following some examples (e. g. Aem) and open a PR if it works out.

@FDelporte
Copy link
Member

Thanks for the feedback and looking forward to your PR!
@lburaggi maybe you can add more ideas here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants