Thanks Timon for the suggestion! I am used to follow that way using the Ant-based NetBeans module/suite/application projects, but I was hoping with Maven that could be avoided given that Maven takes care of dependencies itself. I guess the problem is that Maven dependencies are transitive whereas NetBeans ones are not. I was in fact reading this https://bits.netbeans.org/mavenutilities/nbm-maven-plugin/ hoping something clever was going to happen.
Our current problem is that we have 50+ libraries to ship with our RCP application and some of them have very log chain of dependencies and handling all the dependency graph by hand is a nightmare... Any other suggestions? Thanks! On Fri, 25 Oct 2019 at 02:31, Timon Veenstra <mon...@gmail.com> wrote: > Hi Matteo, > > The way to share dependencies between netbeans platform modules is to > create library wrapper modules. > - Create a new netbeans platform module > - add the dependency > - declare public packages > > A little more elaborate description can be found here: > > https://ljelonek.wordpress.com/2011/04/19/netbeans-maven-library-wrapper-modules/ > > Cheers, > Timon > > On Thu, Oct 24, 2019 at 7:29 PM Matteo Di Giovinazzo <matte...@gmail.com> > wrote: > > > I'm trying to mavenize our NB RCP app, but I do not understand how to add > > 3rd party libraries. > > I have an app (nbappmaven) with two modules (module1 and module2) and > both > > need the same library, say gitlab4j (with all dependencies is about 7 MB > of > > jars). > > > > I tried several approaches but without luck: > > > > 1. I declared the dependency in both modules but I ended up with the > > needed jars in both these folders: > > - > > > > > nbappmaven\application\target\nbappmaven\nbappmaven\modules\ext\com.mycompany.module1 > > - > > > > > nbappmaven\application\target\nbappmaven\nbappmaven\modules\ext\com.mycompany.module2 > > 2. I declared the dependency in the application Maven project, but it > is > > not picked up by the two modules... > > 3. I declared the dependency in the parent Maven project > > (nbappmaven-parent), but now I have the jars in 3 folders... > > - > > > > > nbappmaven\application\target\nbappmaven\nbappmaven\modules\ext\com.mycompany.module1 > > - > > > > > nbappmaven\application\target\nbappmaven\nbappmaven\modules\ext\com.mycompany.module2 > > - > > > > > nbappmaven\application\target\nbappmaven\nbappmaven\modules\ext\com.mycompany.nbappmaven-branding > > > > Is there a suggested approach in this case? I guess it will be pretty > > common to share the same library among different modules, no? > > > > Thanks for any hint! > > > > Best, > > -- > > Matteo Di Giovinazzo > > > -- Matteo Di Giovinazzo