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.
Summary: | Action wizard generates code for 6.10 when running with maven dep RELEASE691 | ||
---|---|---|---|
Product: | apisupport | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Maven | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | musilt2 |
Priority: | P2 | ||
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jaroslav Tulach
2010-09-04 17:52:20 UTC
Improved in core-main #866eef548f80 to at least work if you already have the dep on org.netbeans.api:org-openide-awt in your POM. (MavenProject.getDependencyArtifacts just seems to return null now in M3, for no clear reason. As usual, Javadoc makes no mention of this possibility.) Making it work if the dep is not yet there will be trickier. Impossible if you have *no* deps on some NB API, which is why the archetype includes an initial dep on org.openide.util. MavenNbModuleImpl.addDependency does try to look for "sibling" dependencies and copy the same version, and getDependencyVersion could probably use the same trick. Integrated into 'main-golden', will be available in build *201009220000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/866eef548f80 User: Jesse Glick <jglick@netbeans.org> Log: #190149 (partial): getDependencyVersion was always returning null in platform app modules. *** Bug 190971 has been marked as a duplicate of this bug. *** Pretty visible, needs to be fixed even if easy to work around. Ideally would be tested by something like this: public void testGetDependencyVersion() throws Exception { TestFileUtils.writeFile(wd, "pom.xml", "<project><modelVersion>4.0.0</modelVersion>" + "<groupId>test</groupId><artifactId>prj</artifactId>" + "<packaging>nbm</packaging><version>1.0</version>" + "<build><plugins><plugin><groupId>org.codehaus.mojo</groupId><artifactId>nbm-maven-plugin</artifactId><extensions>true</extensions></plugin></plugins></build>" + "<dependencies><dependency><groupId>org.netbeans.api</groupId><artifactId>org-netbeans-api-annotations-common</artifactId><version>RELEASE691</version></dependency></dependencies>" + "</project>"); Project p = ProjectManager.getDefault().findProject(wd); assertNotNull(p); NbModuleProvider nbmp = p.getLookup().lookup(NbModuleProvider.class); assertNotNull(nbmp); assertEquals("8.3.1", String.valueOf(nbmp.getDependencyVersion("org.openide.util.lookup"))); } However this requires various artifacts to be present in the local repo, and the repository index to be current - probably out of range of a unit test. core-main #195d6ed8c9ca Integrated into 'main-golden', will be available in build *201010251131* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/195d6ed8c9ca User: Jesse Glick <jglick@netbeans.org> Log: #190149: Action wizard generates code for 6.10 when running with maven dep RELEASE691 |