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.

Bug 254099 - Related archetype Java projects - m2 compiles even though the correct import is not specified.
Summary: Related archetype Java projects - m2 compiles even though the correct import ...
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 05:05 UTC by rashmidixit
Modified: 2015-09-07 11:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rashmidixit 2015-08-03 05:05:57 UTC
I am following the test case

http://services.netbeans.org/synergy/client/app/#/assignment/1348/v/1

Create new Maven java application from maven-quickstart archetype (m1)
Build it to install JAR into local repo
Create another new Maven java application from maven-quickstart archetype (m2)
Build it to install JAR into local repo
Add to dependencies in (m2) dependency on (m1)
Open predefined App.java in (m2) and try to use in code predefined App.java from (m1)
Check also that Go to source works and opens App.java from (m1)


Here I added a new static function to m1.App class and I called the same function in m2 main class. Although the file shows errors in the Project folder. If i do a compile of through maven, the build is successful. However, a run of the file throws up an error

Executing command line: C:\Program Files\Java\jdk1.8.0_40\bin\java.exe -classpath D:\NetCat\m2\target\classes;D:\NetCat\m1\target\classes com.mycompany.m2.App
Hello World!
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: m1.App.hello
	at com.mycompany.m2.App.main(App.java:13)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.173s
Finished at: Mon Aug 03 10:31:51 IST 2015
Final Memory: 5M/123M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project m2: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project m2: Command execution failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
Comment 1 alied 2015-09-05 03:03:02 UTC
Cannot reproduce
Product Version: NetBeans IDE Dev (Build 201509040002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 4.1.6+ running on amd64; UTF-8; en_US (nb)
User directory: /home/alied/.netbeans/dev
Cache directory: /home/alied/.cache/netbeans/dev
Comment 2 Tomas Stupka 2015-09-07 11:43:09 UTC
cannot reproduce either