Bug 197381 - [70cat][maven] Compilation error hyperlinks misparsed when on different Windows drive
[70cat][maven] Compilation error hyperlinks misparsed when on different Windo...
Status: VERIFIED FIXED
Product: projects
Classification: Unclassified
Component: Maven
7.0
PC Windows XP
: P2 (vote)
: 7.0.1
Assigned To: Jesse Glick
issues@projects
http://jira.codehaus.org/browse/MCOMP...
70patch1-verified
:
: 197448 198493 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-04 07:58 UTC by jmborer
Modified: 2011-05-20 07:32 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmborer 2011-04-04 07:58:37 UTC
When building with Maven, the error hyperlinks no longer work: they neither open the related file, nor go the error line.

Product Version: NetBeans IDE 7.0 RC1 (Build 201103280000)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: H:\projects\.netbeans\7.0rc1
Maven: 3.0.3

Error navigation still works with ant based Netbeans projects.
Comment 1 Tomas Danek 2011-04-04 12:43:32 UTC
unable to reproduce both on XP and OS X, on 7.0 rc1 JDK 6u24.

- create maven java application
- modify App.java class (e.g. change System.out to System.outxxx)
- save file
- close editor window
- clean an build
- click on hyperlink showing compilation error in output window
-> editor with App.java gets opened with cursor on desired line.

Closing as worksforme, please reopen with detailed steps, how we can reproduce from scratch, thanks.
Comment 2 jmborer 2011-04-04 20:25:53 UTC
I cleaned up all my caches. No more user dir.

When I execute the steps below, it simply doesn't work: clicking on the error hyperlink does nothing.

I use an external Maven 3.0.3 installation. I'll do so other tests tomorrow to see if I can restore error navigation.
Comment 3 Tomas Danek 2011-04-04 21:25:41 UTC
The only idea i have is that possible problem could be if hyperlink contains path with space (e.g. you project is located in c:\My Folder With Space\project). Is that the case?
> When I execute the steps below, it simply doesn't work: clicking on the error
> hyperlink does nothing.
Please try also with bundled, but i guess it should not make difference. 
> I use an external Maven 3.0.3 installation. I'll do so other tests tomorrow to
> see if I can restore error navigation.
Comment 4 jmborer 2011-04-05 09:30:53 UTC
Using the bundled Maven does not make any difference. As I told Jesse Glick on the netcat mailing list: hyperlink navigation in compilation errors works on Mac OS X and not on Windows (at least mine). I flushed everything and installed no additional plugin. I suspect now that the problem is related to the path: no drive letter prefix in the paths: 


Apache Maven 3.0.3 (r1075438; 2011-02-28 17:31:09+0000)
Maven home: C:\Program Files\netbeans\7.0rc1\java\maven\bin\..
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\java\jdk1.6.0_23\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
Scanning for projects...

------------------------------------------------------------------------
Building mavenproject2 1.0-SNAPSHOT
------------------------------------------------------------------------

[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory H:\lab\mavenproject2\src\main\resources

[compiler:compile]
Compiling 1 source file to H:\lab\mavenproject2\target\classes
-------------------------------------------------------------
COMPILATION ERROR :
-------------------------------------------------------------
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,27]
';' expected
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,63]
not a statement
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,92]
';' expected
3 errors
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.694s
Finished at: Tue Apr 05 09:22:35 GMT 2011
Final Memory: 3M/15M
------------------------------------------------------------------------
Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project mavenproject2: Compilation failure:
Compilation failure:
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,27]
';' expected
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,63]
not a statement
\lab\mavenproject2\src\main\java\ch\skyguide\inch\mavenproject2\App.java:[14,92]
';' expected
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please
read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Comment 5 Tomas Danek 2011-04-05 09:45:41 UTC
Windows FS problem?!
Comment 6 Tomas Danek 2011-04-05 09:47:35 UTC
btw: your drive H: is local filesystem, or some mounted network FS?
Comment 7 jmborer 2011-04-05 10:05:25 UTC
Local filesystem.
Comment 8 jmborer 2011-04-05 10:06:26 UTC
However at runtime, exception stack navigation works fine:


Apache Maven 3.0.3 (r1075438; 2011-02-28 17:31:09+0000)
Maven home: C:\Program Files\netbeans\7.0rc1\java\maven\bin\..
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\java\jdk1.6.0_23\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
Scanning for projects...

------------------------------------------------------------------------
Building mavenproject2 1.0-SNAPSHOT
------------------------------------------------------------------------

[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory H:\lab\mavenproject2\src\main\resources

[compiler:compile]
Nothing to compile - all classes are up to date

[exec:exec]
java.lang.ExceptionInInitializerError
Caused by: java.util.MissingResourceException: Can't find bundle for
base name bundly, locale en_US
       at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
       at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
       at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
       at ch.skyguide.inch.mavenproject2.App.<clinit>(App.java:11)
Could not find the main class: ch.skyguide.inch.mavenproject2.App.
Program will exit.
Exception in thread "main" [INFO]
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.956s
Finished at: Tue Apr 05 09:24:20 GMT 2011
Final Memory: 3M/15M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec
(default-cli) on project mavenproject2: Command execution failed.
Process exited with an error: 1(Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please
read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Comment 9 jmborer 2011-04-05 10:22:28 UTC
Compilation error navigation works on my XP with Netbeans 6.9.1 and Maven 2.2.1
Comment 10 jmborer 2011-04-05 10:23:31 UTC
Compilation error navigation does not work with Netbeans 7.0rc1 and Maven 2.2.1
Comment 11 jmborer 2011-04-05 10:31:05 UTC
The bug is still present in Netbeans 7.0 rc2
Comment 12 Tomas Danek 2011-04-05 11:17:31 UTC
reproduced:
What makes difference is where you place your project, there are two types of hyperlinks:

case 1:
- project in default location in NetbeansProjects folder on C: drive, error navigation works fine, error hyperlink seems to be relative to sourceroot
-------------------------------------------------------------
COMPILATION ERROR : 
-------------------------------------------------------------
com/mycompany/mavenproject1/App.java:[11,14] cannot find symbol
symbol  : variable ouxxxxt
location: class java.lang.System
1 error

case 2:
- project in e.g. H:\NB folder, error navigation does not work,hyperlink is absolute, but "H:" is omitted from path:
-------------------------------------------------------------
COMPILATION ERROR : 
-------------------------------------------------------------
\NB\mavenproject2\src\main\java\com\mycompany\mavenproject2\App.java:[11,14] cannot find symbol
symbol  : variable ouxxxxt
location: class java.lang.System
1 error
Comment 13 Jesse Glick 2011-04-05 13:58:30 UTC
Looks like a Maven bug; command-line javac prints full path names without any issue, but command-line Maven (3.0.3 tested) prints path names without a drive letter. This is true for both the C: and the F: projects I made (though the IDE managed to hyperlink only the C: project for some reason). Need to file the upstream bug.

NB 6.9 does not hyperlink output from _either_ project when using M3, and 7.0 in my tests does hyperlink both projects when Maven 2.2.1 is used, so this is no regression.
Comment 14 Jesse Glick 2011-04-05 14:27:40 UTC
Upstream bug already filed, apparently causing similar problems in IDEA.
Comment 15 Jesse Glick 2011-04-05 15:17:12 UTC
Filed a patch for upstream bug; I hope that will make it into the next release of the compiler plugin. Still need a workaround in NB for the benefit of projects using older versions of the plugin.
Comment 16 Jesse Glick 2011-04-05 16:59:24 UTC
Workaround in NB seems pretty safe, so up to QE whether to accept it in 7.0 or leave it for an update. Will affect anyone developing a Java-oriented Maven project (using more or less current versions of the compiler plugin) on a Windows drive distinct from that of the IDE's working directory (which is arbitrary but may correspond to the location of the IDE installation).
Comment 17 Jesse Glick 2011-04-05 17:17:03 UTC
core-main #9351eabe7f43
Comment 18 Tomas Danek 2011-04-05 17:32:33 UTC
it really looks like that workaround should not do any harm, so i'd vote for porting to 7.0 once I verify it in trunk.
Comment 19 Marian Mirilovic 2011-04-05 20:52:38 UTC
(In reply to comment #18)
> it really looks like that workaround should not do any harm, so i'd vote for
> porting to 7.0 once I verify it in trunk.

If it will not be in release70 in next 70 minutes, it won't be in NB 7.0. So I vote to leave it for NB 7.0.1
Comment 20 Jesse Glick 2011-04-05 21:51:15 UTC
I think it can be skipped. Hyperlinking of errors is basic, but not critical, functionality; you can always jump to the mentioned class and line manually. (Especially javac errors, which would normally be displayed in the IDE's editor to begin with.)

I just thought of a hypothetical bug in this impl, too, though I cannot think of a way to trigger it; relates to UNC paths. core-main #83295a14b9c6
Comment 21 Quality Engineering 2011-04-06 08:45:16 UTC
Integrated into 'main-golden', will be available in build *201104060400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9351eabe7f43
User: Jesse Glick <jglick@netbeans.org>
Log: #197381: [70cat][maven] Compilation error hyperlinks misparsed when on different Windows drive
Comment 22 Tomas Danek 2011-04-06 09:51:57 UTC
verified in trunk.

Product Version: NetBeans IDE Dev (Build 201104060400)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\tomas\.netbeans\dev
Comment 23 Marian Mirilovic 2011-04-06 15:06:02 UTC
*** Bug 197448 has been marked as a duplicate of this bug. ***
Comment 24 Quality Engineering 2011-04-07 08:44:48 UTC
Integrated into 'main-golden', will be available in build *201104070400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/83295a14b9c6
User: Jesse Glick <jglick@netbeans.org>
Log: #197381 cont'd: refinement to ignore UNC paths.
Comment 25 Marian Mirilovic 2011-05-02 09:00:38 UTC
*** Bug 197915 has been marked as a duplicate of this bug. ***
Comment 26 Marian Mirilovic 2011-05-16 08:04:59 UTC
*** Bug 198493 has been marked as a duplicate of this bug. ***
Comment 27 Jesse Glick 2011-05-16 21:46:59 UTC
releases #11d95f28d48d, releases #c48f0fbea650, releases #4bba1140ade6
Comment 28 Tomas Danek 2011-05-20 07:32:03 UTC
v. in 70patch1


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo