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.
Created attachment 144613 [details] Comparison of 7.4 and 8.0 project views I import a NB 7.4 project which is a Maven project with a Spring MVC/AngularJS on the UI and Spring/Jersey/JAXWS on the server to NB 8.0. When importing, it prompted me to upgrade the project and upgraded successfully. However when I look in the projects view, I don't see my webapp (Web Pages). See attachment - nb-7.4-8.0.png. Looking in the project properties, the Javascript files section shows an error: Invalid web/site root provided. This pretty much prevents using NB for any JSP/JS/HTML development. Pl let me know if you need addl information
Not sure if this is a NB issue, but I was able to resolve it by removing references to ${basedir} in pom.xml and just use '/' to refer to the root.
can you attach the relevant pom.xml snippet?
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> If I remove ${basedir} in above, it works in NB 8. The above works fine in NB7.4 as is.
mjanicek: please evaluate, if the war plugin accepts both variants, so should we. Maybe we don't exaluate the value properly?
I added this plugin: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <echo>BASEDIR:${basedir}</echo> </tasks> </configuration> </execution> </executions> </plugin> The echo is printing out the right path.
Fixed by change-set: web-main #f682abfa001e Thank you for the report!
Integrated into 'main-silver', will be available in build *201402040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f682abfa001e User: Martin Janicek <mjanicek@netbeans.org> Log: #241205 - Imported maven project from 7.4 missing webapp in projects (Web Pages)
I think 'fix' is not completely correct - current implementation ... http://hg.netbeans.org/main/file/ef35591e2d0f/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebProjectWebRootProvider.java#l133 // Try to find resources root using absolute path --> See issue #241205 return FileUtil.toFileObject(FileUtil.normalizeFile(new File(webSourceDir))); .. says it is checking 'absolute path', but does not check if path is really absolute. In case when MAVEN project does not have "src/main/webapp" next attempt (when webSourceDir is not absolute) will be actually performed against that folder: C:\<NetBeans install root>\src\main\webapp I guess correct code will look like this // Try to find resources root using absolute path --> See issue #241205 File absWebRoot = new File(webSourceDir); return !absWebRoot.isAbsolute() ? null : FileUtil.toFileObject(FileUtil.normalizeFile(absWebRoot));