views:

24

answers:

2

I have 2 completely separate projects where one depends on the other. I've very recently mavenized the main project but can mavenise the dependency if absolutely necessary.

Originally these were Netbeans projects, with the main project having several modules. What I liked is that I could declare the dependency as a dependent project. This allowed me to use the most recent code as it changes a lot (the project is in its infancy). NetBeans would put the dependent project on the classpath when running, and build a jar in the /dist directory when doing a clean and build.

Now that the main project is in maven, I can't do this anymore. The only alternative I've found was to manually copy it into the project repository, but that removes a lot of automation and ease of use. Every time I wanted to test a change I would have to rebuild the dependency, move it to the buried project repository folder, rename it appropiatly, switch back to NetBeans, then run. This is vs clicking run and everything being done automatically.

Maybe I'm just lazy, but is there an easy way to do this?

+1  A: 

I have 2 completely separate projects where one depends on the other. I've very recently mavenized the main project but can mavenize the dependency if absolutely necessary.

Mavenizing the dependent project would help a lot. Like Eclipse or IntelliJ, NetBeans supports something Eclipse calls Workspace dependency resolution: if a project A depends on a project B and you open both of them in your IDE, A can be configured to depend on B sources instead of B jar (and any change would become immediately visible).

Pascal Thivent
Well I went ahead and mavenized the dependency, then was finally able to add it. Thanks for the help!
TheLQ
+1  A: 

mavenizing the depedency project is the best option.

Alternatively you might get away with using a system scope dependency which points to the dependency project's dist/ folder jar artifact.

mkleint
I've already solved the problem by mavenizing the project, and it seems to work. Thanks for the answer though
TheLQ