This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have a project structured thusly: - parent -- pom.xml - module1 -- src -- pom.xml - module2 -- src -- pom.xml - webmodule -- src -- pom.xml pom.xml The last pom serves as a maven reactor, defining all modules: <modules> <module>parent</module> <module>module1</module> <module>module2</module> <module>web</module> </modules> In, up to and including, 6.9.1 I can click "Build with dependencies". The consequence is that it builds all dependencies as I expected. In the 7.0 releases so far (including RC1) it fails. This seems to be because it changes directory to the parent module before running: cd D:\xx\project\parent; JAVA_HOME=D:\\bin\\java\\x64\\jdk6 mvn.bat --also-make --projects <groupid>:<artifactid> install I note that this would work if one uses only 1 pom.xml as both parent and reactor.
ReactorChecker is looping on MavenProject.parent until it finds one whose parent has no basedir, then setting RunConfig.executionDirectory to the last basedir encountered. As you found, this will behave incorrectly in case parent/relativePath is not the default of ../pom.xml; would also fail if the parent did not list the child as a module. (6.9 has a more simplistic version of BwD which just hardcodes executionDirectory=.., which will (a) fail for a project not inside a reactor, (b) not start "high enough" for a submodule in a big reactor like Glassfish.) I guess the logic should rather be to walk up the directory hierarchy so long as the parent dir contains a valid pom.xml and that MavenProject.modules indeed lists the subdir. Even that could fail in case some element in modules is of the form ../x or x/y or otherwise not a simple subdirectory, though I guess this would be rare. A hybrid strategy would be to search parent/relativePath, and failing that ../pom.xml if different, looking for a project listing the current project as a module. Another tricky point is deciding which profile(s) to apply when loading the parent MavenProject, since that can affect the list of modules; for example, https://svn.apache.org/repos/asf/felix/trunk/pom.xml needs to be in the packaging-bundle profile for BwD to work on .../framework/pom.xml but (since this profile is inactive by default) BwD will fail unless the IDE passes -Ppackaging-bundle and then that could interfere with other modules.
Regression from 6.9, but probably not a P2 requiring backport to 7.0 since there is a straightforward workaround: run Build on the reactor root.
core-main #c5d507c05c53
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/c5d507c05c53 User: Jesse Glick <jglick@netbeans.org> Log: #197232: "Build with Dependencies" fails when parent/relativePath != ../pom.xml
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/3fcc85188c49 User: Jesse Glick <jglick@netbeans.org> Log: #197232 (--also-make) tweaks. 1. Behave properly when the project is unloadable. 2. Skip -am/-amd + -pl when there is no distinct reactor root.