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

Allow classpath to be built without relying on the main jar artifact #237

Closed
snicoll opened this issue May 18, 2022 · 1 comment · Fixed by #247
Closed

Allow classpath to be built without relying on the main jar artifact #237

snicoll opened this issue May 18, 2022 · 1 comment · Fixed by #247
Labels
enhancement New feature or request maven-plugin Related to Maven plugin
Milestone

Comments

@snicoll
Copy link
Collaborator

snicoll commented May 18, 2022

Is your feature request related to a problem? Please describe.
The plugin currently lets us build the classpath ourselves or use a default that includes compile and runtime dependencies, as well as the main artifact.

The main artifact may not be the regular jar of the project, and NBT therefore fails to find the main class (or any class required by the project). This is case with Spring Boot as our repackage goal makes the "application" jar the main artifact. There is a way to configure this differently but we'd like this to work out-of-the-box.

Describe the solution you'd like
This is not the first time a plugin has to chose between using target/classes as the "classpath of the project" over the jar file produced for the main artifact. For instance, the failsafe-maven-plugin offers an option that let users chose between those two options, see https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#classesDirectory. We also document this in our documentation.

Describe alternatives you've considered
Building the classpath ourselves but doing so in the parent looks really unpleasant.

Additional context
None.

@sdeleuze
Copy link
Collaborator

It seems after changes from #247 we even don't have to customize the classifier to make Spring Boot fine, with 0.9.12+ it works by default. Not sure if that was expected, but good surprise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maven-plugin Related to Maven plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants