I'm somewhat new to using Maven projects in Netbeans, but I really like it. The only thing that seems kind of a pain is actually deploying to a an executable jar with the dependencies.
I've added various plugins to my POM file, including maven-jar-plugin
& maven-shade-plugin
, which enhance and fully automate the jar build process. I also have the project set to package
on Clean & Build
. The real problem is that apparently the shade
plugin breaks Netbeans's ability to run projects among other things. This can be fixed... by removing the shade
plugin, but this switching on and off by editing code in the POM is moderately frustrating and an ineffective use of time.
Is there a way where I can build an executable jar file with the dependencies for testing the program outside the IDE environment on every Clean & Build
without breaking the Maven Project in the IDE? Preferable a plugin that doesn't break the Netbeans IDE in the same way as shade
.
When the final artifact jar contains classes not originating in current project, NetBeans internal compiler cannot use the sources of the project for compilation. Then changes done in project's source code only appears in depending projects when project is recompiled. Also applies to features like Refactoring which will not be able to find usages in depending projects.