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 154507 - [codehaus] <Badly formed Maven project> when using dependency of system type
Summary: [codehaus] <Badly formed Maven project> when using dependency of system type
Status: RESOLVED DUPLICATE of bug 191176
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-03 16:28 UTC by Jaromir Uhrik
Modified: 2010-10-20 17:56 UTC (History)
2 users (show)

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 Jaromir Uhrik 2008-12-03 16:28:12 UTC
This issue was originally reported by Daniel Mutch in 15/Jul/07 at codehaus.org - see more details at
http://jira.codehaus.org/browse/MEVENIDE-542
Environment: Windows 2000

===========
Description:
===========
Adding the following profile to a pom.xml seems to render the project invalid
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${JAVA_1_4_HOME}/lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
It appears to be the dependencies. Commenting them out solves the problem.

----------------------------------------------
Comment by Daniel Mutch [ 02/Sep/07 07:32 PM ]
----------------------------------------------
By making ${JAVA_1_4_HOME} a system variable the POM loads fine. If however it is defined in a parent project instead
you get invalid project issue.

----------------------------------------------
Comment by Milos Kleint [ 18/Apr/08 07:23 AM ]
----------------------------------------------
the correct way of referencing environment variables is to use the ${env.JAVA_1_4_HOME} pattern.
However while that seems to work for build of the project, the loading of the project fails in this case. I suppose
that's an issue within maven itself. The env.JAVA_1_4_HOME property cannot only be found in the <system> element. When
defined in profile's activation for example, it seems to resolve fine.

----------------------------------------------
Comment by Milos Kleint [ 23/May/08 06:05 AM ]
----------------------------------------------
most probably a maven embedder issue ->3.2
Comment 1 Milos Kleint 2009-04-06 12:41:13 UTC
*** Issue 158700 has been marked as a duplicate of this issue. ***
Comment 2 Antonin Nebuzelsky 2010-07-30 15:17:05 UTC
Reassigning to default owner.
Comment 3 Jesse Glick 2010-08-18 18:31:03 UTC
Same problem when using M3 embedder.

One workaround is to use ${java.home}/../lib/tools.jar although that does not enforce that you are actually using tools.jar from JDK 1.4.

http://jira.codehaus.org/browse/MNG-1867 means that this use of system scope might be superseded in Maven 3.x, so I do not consider this issue a priority to fix.
Comment 4 Jesse Glick 2010-10-20 17:56:17 UTC
Fix of bug #191176 seems to work for environment variables as well.

*** This bug has been marked as a duplicate of bug 191176 ***