Won't compile because of transitive dependency not finding its artifact

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Won't compile because of transitive dependency not finding its artifact

borutb
My project builds ok in command line, but in Eclipse with 0.0.10 I can not get rid of

22.2.07 16:00:44 CET: Missing:
1) com.sun:tools:jar:1.5.0
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
          -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
      1) com.interseek:feed-index-server:jar:1.1.5
      2) org.htmlparser:htmlparser:jar:1.6
      3) com.sun:tools:jar:1.5.0
1 required artifact is missing.
for artifact:
  com.interseek:feed-index-server:jar:1.1.5
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


At first I thought the artifact is really missing but it is not. Then I discovered one of my project's dependency

        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
            <version>1.6</version>
        </dependency>

is itself dependent on

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>

I have put an ant task in my pom to display the ${java.home} just to be sure where it is pointing

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echohome</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>JAVA_HOME=${java.home}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It prints

[INFO] [antrun:run {execution: echohome}]
     [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre

I have set the system user variable JAVA_HOME to both
  • C:\Program Files\Java\jdk1.5.0_11\jre
  • C:\Program Files\Java\jdk1.5.0_11
and none of them helps getting rid of red error icon on my project's pom.xml which is well-formed and valid.

Any help appreciated,
Borut

Reply | Threaded
Open this post in threaded view
|

RE: Won't compile because of transitive dependency not finding its artifact

Chris Hilton-2
Go to Help->About Eclipse SDK->Configuration Details. See what the java.home property there is set to and report back. Please.
 
Chris


From: Borut Bolčina [mailto:[hidden email]]
Sent: Thursday, 22 February, 2007 09:14
To: [hidden email]
Subject: [m2eclipse-user] Won't compile because of transitive dependency not finding its artifact

My project builds ok in command line, but in Eclipse with 0.0.10 I can not get rid of

22.2.07 16:00:44 CET: Missing:
1) com.sun:tools:jar:1.5.0
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
          -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
      1) com.interseek:feed-index-server:jar:1.1.5
      2) org.htmlparser:htmlparser:jar:1.6
      3) com.sun:tools:jar:1.5.0
1 required artifact is missing.
for artifact:
  com.interseek:feed-index-server:jar:1.1.5
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


At first I thought the artifact is really missing but it is not. Then I discovered one of my project's dependency

        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
            <version>1.6</version>
        </dependency>

is itself dependent on

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>

I have put an ant task in my pom to display the ${java.home} just to be sure where it is pointing

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echohome</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>JAVA_HOME=${java.home}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It prints

[INFO] [antrun:run {execution: echohome}]
     [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre

I have set the system user variable JAVA_HOME to both
  • C:\Program Files\Java\jdk1.5.0_11\jre
  • C:\Program Files\Java\jdk1.5.0_11
and none of them helps getting rid of red error icon on my project's pom.xml which is well-formed and valid.

Any help appreciated,
Borut

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

borutb
Now I see it! There is an entry:

java.home=C:\Program Files\Java\jre1.5.0_11

which is jre and therefore doesn't have tools.jar. How to convince Eclipse to point to C:\Program Files\Java\jdk1.5.0_11?

But then...the

<systemPath>${java.home}/../lib/tools.jar</systemPath>

suggests that java.home in Eclipse should be

java.home=C:\Program Files\Java\jdk1.5.0_11\jre

to correctly locate tools.jar.


On 22.2.2007 16:20, Chris Hilton wrote:
Go to Help->About Eclipse SDK->Configuration Details. See what the java.home property there is set to and report back. Please.
 
Chris


From: Borut Bolčina [[hidden email]]
Sent: Thursday, 22 February, 2007 09:14
To: [hidden email]
Subject: [m2eclipse-user] Won't compile because of transitive dependency not finding its artifact

My project builds ok in command line, but in Eclipse with 0.0.10 I can not get rid of

22.2.07 16:00:44 CET: Missing:
1) com.sun:tools:jar:1.5.0
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
          -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
      1) com.interseek:feed-index-server:jar:1.1.5
      2) org.htmlparser:htmlparser:jar:1.6
      3) com.sun:tools:jar:1.5.0
1 required artifact is missing.
for artifact:
  com.interseek:feed-index-server:jar:1.1.5
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


At first I thought the artifact is really missing but it is not. Then I discovered one of my project's dependency

        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
            <version>1.6</version>
        </dependency>

is itself dependent on

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>

I have put an ant task in my pom to display the ${java.home} just to be sure where it is pointing

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echohome</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>JAVA_HOME=${java.home}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It prints

[INFO] [antrun:run {execution: echohome}]
     [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre

I have set the system user variable JAVA_HOME to both
  • C:\Program Files\Java\jdk1.5.0_11\jre
  • C:\Program Files\Java\jdk1.5.0_11
and none of them helps getting rid of red error icon on my project's pom.xml which is well-formed and valid.

Any help appreciated,
Borut


--
bbLOG
Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

borutb
Ok, the solution was to run Eclipse with
-Djava.home="C:\Program Files\Java\jdk1.5.0_11\jre"

Dont't know if this will break other projects, will have to investigate some more.


On 22.2.2007 16:32, Borut Bolčina wrote:
Now I see it! There is an entry:

java.home=C:\Program Files\Java\jre1.5.0_11

which is jre and therefore doesn't have tools.jar. How to convince Eclipse to point to C:\Program Files\Java\jdk1.5.0_11?

But then...the

<systemPath>${java.home}/../lib/tools.jar</systemPath>

suggests that java.home in Eclipse should be

java.home=C:\Program Files\Java\jdk1.5.0_11\jre

to correctly locate tools.jar.


On 22.2.2007 16:20, Chris Hilton wrote:
Go to Help->About Eclipse SDK->Configuration Details. See what the java.home property there is set to and report back. Please.
 
Chris


From: Borut Bolčina [[hidden email]]
Sent: Thursday, 22 February, 2007 09:14
To: [hidden email]
Subject: [m2eclipse-user] Won't compile because of transitive dependency not finding its artifact

My project builds ok in command line, but in Eclipse with 0.0.10 I can not get rid of

22.2.07 16:00:44 CET: Missing:
1) com.sun:tools:jar:1.5.0
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
          -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
      1) com.interseek:feed-index-server:jar:1.1.5
      2) org.htmlparser:htmlparser:jar:1.6
      3) com.sun:tools:jar:1.5.0
1 required artifact is missing.
for artifact:
  com.interseek:feed-index-server:jar:1.1.5
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


At first I thought the artifact is really missing but it is not. Then I discovered one of my project's dependency

        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
            <version>1.6</version>
        </dependency>

is itself dependent on

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>

I have put an ant task in my pom to display the ${java.home} just to be sure where it is pointing

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echohome</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>JAVA_HOME=${java.home}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It prints

[INFO] [antrun:run {execution: echohome}]
     [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre

I have set the system user variable JAVA_HOME to both
  • C:\Program Files\Java\jdk1.5.0_11\jre
  • C:\Program Files\Java\jdk1.5.0_11
and none of them helps getting rid of red error icon on my project's pom.xml which is well-formed and valid.

Any help appreciated,
Borut


--
bbLOG

--
bbLOG
Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

Eugene Kuleshov
In reply to this post by borutb

  Is this problem with dependency resolver, or when you launch Maven
from within Eclipse?
  The former is using JRE Eclipse is running on.
  The latter is using installed JRE configuration. See Window /
Preferences... / Java / Installed JREs

  So, if any of those will have C:\Program Files\Java\jdk1.5.0_11 and
NOT C:\Program Files\Java\jdk1.5.0_11\jre, embedder Maven won't be able
to resolve your declaration ${java.home}/../lib/tools.jar

  regards,
  Eugene
 

Borut Bolčina wrote:

> My project builds ok in command line, but in Eclipse with 0.0.10 I can
> not get rid of
>
> 22.2.07 16:00:44 CET: Missing:
> 1) com.sun:tools:jar:1.5.0
>   Try downloading the file manually from the project website.
>   Then, install it using the command:
>       mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
>           -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
>   Path to dependency:
>       1) com.interseek:feed-index-server:jar:1.1.5
>       2) org.htmlparser:htmlparser:jar:1.6
>       3) com.sun:tools:jar:1.5.0
> 1 required artifact is missing.
> for artifact:
>   com.interseek:feed-index-server:jar:1.1.5
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
>
>
> At first I thought the artifact is really missing but it is not. Then
> I discovered one of my project's dependency
>
>         <dependency>
>             <groupId>org.htmlparser</groupId>
>             <artifactId>htmlparser</artifactId>
>             <version>1.6</version>
>         </dependency>
>
> is itself dependent on
>
>         <dependency>
>           <groupId>com.sun</groupId>
>           <artifactId>tools</artifactId>
>           <version>1.5.0</version>
>           <scope>system</scope>
>           <systemPath>${java.home}/../lib/tools.jar</systemPath>
>         </dependency>
>
> I have put an ant task in my pom to display the ${java.home} just to
> be sure where it is pointing
>
>             <plugin>
>                 <artifactId>maven-antrun-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>echohome</id>
>                         <phase>validate</phase>
>                         <goals>
>                             <goal>run</goal>
>                         </goals>
>                         <configuration>
>                             <tasks>
>                                 <echo>JAVA_HOME=${java.home}</echo>
>                             </tasks>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
> It prints
>
> [INFO] [antrun:run {execution: echohome}]
>      [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre
>
> I have set the system user variable JAVA_HOME to both
>
>     * C:\Program Files\Java\jdk1.5.0_11\jre
>     * C:\Program Files\Java\jdk1.5.0_11
>
> and none of them helps getting rid of red error icon on my project's
> pom.xml which is well-formed and valid.
>
> Any help appreciated,
> Borut
>
>
> ------------------------------------------------------------------------
> If this email is spam, report it here:
> http://www.OnlyMyEmail.com/ReportSpam 
> <http://www.OnlyMyEmail.com/reportSpam?Id=NjAxNzA6MjYxNTQxMzIwOmV1QG1kLnBwLnJ1>



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

Eugene Kuleshov
In reply to this post by borutb

  BTW, it is a bad practice to use "..' reference from JRE, because
tools.jar is actually part of JDK, but JRE not necessarily mean that you
have JDK around. So, I' would suggest to set JAVA_HOME to the proper JDK
and use {$java.home}/lib/tools.jar path instead.

  Anyways, please consider to contribute to the project FAQ at
http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ

  regards,
  Eugene


Borut Bolčina wrote:

> Now I see it! There is an entry:
>
> java.home=C:\Program Files\Java\jre1.5.0_11
>
> which is jre and therefore doesn't have tools.jar. How to convince
> Eclipse to point to C:\Program Files\Java\jdk1.5.0_11?
>
> But then...the
>
> <systemPath>${java.home}/../lib/tools.jar</systemPath>
>
> suggests that java.home in Eclipse should be
>
> java.home=C:\Program Files\Java\jdk1.5.0_11\jre
>
> to correctly locate tools.jar.
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

Matt Brozowski

On Feb 22, 2007, at 12:13 PM, Eugene Kuleshov wrote:


 BTW, it is a bad practice to use "..' reference from JRE, because tools.jar is actually part of JDK, but JRE not necessarily mean that you have JDK around. So, I' would suggest to set JAVA_HOME to the proper JDK and use {$java.home}/lib/tools.jar path instead.

 Anyways, please consider to contribute to the project FAQ at http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ

Even that's a bad idea because not all JDKs provide a tools.jar... for example the Mac OSX JDK  bundles the tools.jar code into the classes.jar

You'll need a profile for it at least.

Matt
___________________________________________________________________________
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746


Reply | Threaded
Open this post in threaded view
|

RE: Won't compile because of transitive dependency not finding its artifact

Chris Hilton-2
In reply to this post by borutb
The entry for this in the Maven FAQ does exactly that (though it does recommend the '..' use).
 
 
Chris


From: Matt Brozowski [mailto:[hidden email]]
Sent: Thursday, 22 February, 2007 11:27
To: [hidden email]
Subject: Re: [m2eclipse-user] Won't compile because of transitive dependency not finding its artifact


On Feb 22, 2007, at 12:13 PM, Eugene Kuleshov wrote:


 BTW, it is a bad practice to use "..' reference from JRE, because tools.jar is actually part of JDK, but JRE not necessarily mean that you have JDK around. So, I' would suggest to set JAVA_HOME to the proper JDK and use {$java.home}/lib/tools.jar path instead.

 Anyways, please consider to contribute to the project FAQ at http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ

Even that's a bad idea because not all JDKs provide a tools.jar... for example the Mac OSX JDK  bundles the tools.jar code into the classes.jar

You'll need a profile for it at least.

Matt
___________________________________________________________________________
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746


Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

Eugene Kuleshov
In reply to this post by Matt Brozowski
Matt Brozowski wrote:

>>  BTW, it is a bad practice to use "..' reference from JRE, because
>> tools.jar is actually part of JDK, but JRE not necessarily mean that
>> you have JDK around. So, I' would suggest to set JAVA_HOME to the
>> proper JDK and use {$java.home}/lib/tools.jar path instead.
>>
>>  Anyways, please consider to contribute to the project FAQ at
>> http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ
> Even that's a bad idea because not all JDKs provide a tools.jar... for
> example the Mac OSX JDK  bundles the tools.jar code into the classes.jar
>
> You'll need a profile for it at least.
  Right. I am always forgetting that. Would you mind to add some example
of such profile to the FAQ?

  Thanks

  Eugene



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

Eugene Kuleshov
In reply to this post by Chris Hilton-2

  Apparently that Maven FAQ entry is not always valid.


Chris Hilton wrote:

> The entry for this in the Maven FAQ does exactly that (though it does
> recommend the '..' use).
>  
> http://maven.apache.org/general.html#tools-jar-dependency
>  
> Chris
>
>     ------------------------------------------------------------------------
>     *From:* Matt Brozowski [mailto:[hidden email]]
>     *Sent:* Thursday, 22 February, 2007 11:27
>     *To:* [hidden email]
>     *Subject:* Re: [m2eclipse-user] Won't compile because of
>     transitive dependency not finding its artifact
>
>
>     On Feb 22, 2007, at 12:13 PM, Eugene Kuleshov wrote:
>
>>
>>      BTW, it is a bad practice to use "..' reference from JRE,
>>     because tools.jar is actually part of JDK, but JRE not
>>     necessarily mean that you have JDK around. So, I' would suggest
>>     to set JAVA_HOME to the proper JDK and use
>>     {$java.home}/lib/tools.jar path instead.
>>
>>      Anyways, please consider to contribute to the project FAQ at
>>     http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ
>
>     Even that's a bad idea because not all JDKs provide a tools.jar...
>     for example the Mac OSX JDK  bundles the tools.jar code into the
>     classes.jar
>
>     You'll need a profile for it at least.
>
>     Matt
>     ___________________________________________________________________________
>     Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
>     The OpenNMS Group, Inc. Fax: +1 503 961 7746
>     Email: [hidden email] URL: http://www.opennms.com
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

borutb
In reply to this post by Eugene Kuleshov
Eugene Kuleshov wrote:
>
>  BTW, it is a bad practice to use "..' reference from JRE, because
> tools.jar is actually part of JDK, but JRE not necessarily mean that
> you have JDK around. So, I' would suggest to set JAVA_HOME to the
> proper JDK and use {$java.home}/lib/tools.jar path instead.
But I can't use {$java.home}/lib/tools.jar path as this is not my pom. I
believe there are others out there which use the .. syntax. I will raise
a question on maven user list about that.

>
>  Anyways, please consider to contribute to the project FAQ at
> http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ
>
>  regards,
>  Eugene
>
>
> Borut Bolčina wrote:
>> Now I see it! There is an entry:
>>
>> java.home=C:\Program Files\Java\jre1.5.0_11
>>
>> which is jre and therefore doesn't have tools.jar. How to convince
>> Eclipse to point to C:\Program Files\Java\jdk1.5.0_11?
>>
>> But then...the
>>
>> <systemPath>${java.home}/../lib/tools.jar</systemPath>
>>
>> suggests that java.home in Eclipse should be
>>
>> java.home=C:\Program Files\Java\jdk1.5.0_11\jre
>>
>> to correctly locate tools.jar.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

borutb
In reply to this post by Eugene Kuleshov
Eugene Kuleshov wrote:
>
>  Is this problem with dependency resolver, or when you launch Maven
> from within Eclipse?
With the dependency resolver I guess as I didn't launch Maven with
external tools for this to happen.
>  The former is using JRE Eclipse is running on.
>  The latter is using installed JRE configuration. See Window /
> Preferences... / Java / Installed JREs
>
>  So, if any of those will have C:\Program Files\Java\jdk1.5.0_11 and
> NOT C:\Program Files\Java\jdk1.5.0_11\jre, embedder Maven won't be
> able to resolve your declaration ${java.home}/../lib/tools.jar
This scares me. If a project is developed in Eclipse using m2eclipse
plugin and some dependency is using tools.jar in a .. fashion, then
Eclipse must be started with -Djava.home="C:\Program
Files\Java\jdk1.5.0_11\jre" which of course isn't default. This should
be written somewhere in bold.

Where does Eclipse get its java.home=C:\Program Files\Java\jre1.5.0_11
(in Configuration Details)? It sure doesn't come from JAVA_HOME system
variable.

>
>  regards,
>  Eugene
>
>
> Borut Bolčina wrote:
>> My project builds ok in command line, but in Eclipse with 0.0.10 I
>> can not get rid of
>>
>> 22.2.07 16:00:44 CET: Missing:
>> 1) com.sun:tools:jar:1.5.0
>>   Try downloading the file manually from the project website.
>>   Then, install it using the command:
>>       mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
>>           -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
>>   Path to dependency:
>>       1) com.interseek:feed-index-server:jar:1.1.5
>>       2) org.htmlparser:htmlparser:jar:1.6
>>       3) com.sun:tools:jar:1.5.0
>> 1 required artifact is missing.
>> for artifact:
>>   com.interseek:feed-index-server:jar:1.1.5
>> from the specified remote repositories:
>>   central (http://repo1.maven.org/maven2)
>>
>>
>> At first I thought the artifact is really missing but it is not. Then
>> I discovered one of my project's dependency
>>
>>         <dependency>
>>             <groupId>org.htmlparser</groupId>
>>             <artifactId>htmlparser</artifactId>
>>             <version>1.6</version>
>>         </dependency>
>>
>> is itself dependent on
>>
>>         <dependency>
>>           <groupId>com.sun</groupId>
>>           <artifactId>tools</artifactId>
>>           <version>1.5.0</version>
>>           <scope>system</scope>
>>           <systemPath>${java.home}/../lib/tools.jar</systemPath>
>>         </dependency>
>>
>> I have put an ant task in my pom to display the ${java.home} just to
>> be sure where it is pointing
>>
>>             <plugin>
>>                 <artifactId>maven-antrun-plugin</artifactId>
>>                 <executions>
>>                     <execution>
>>                         <id>echohome</id>
>>                         <phase>validate</phase>
>>                         <goals>
>>                             <goal>run</goal>
>>                         </goals>
>>                         <configuration>
>>                             <tasks>
>>                                 <echo>JAVA_HOME=${java.home}</echo>
>>                             </tasks>
>>                         </configuration>
>>                     </execution>
>>                 </executions>
>>             </plugin>
>>
>> It prints
>>
>> [INFO] [antrun:run {execution: echohome}]
>>      [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre
>>
>> I have set the system user variable JAVA_HOME to both
>>
>>     * C:\Program Files\Java\jdk1.5.0_11\jre
>>     * C:\Program Files\Java\jdk1.5.0_11
>>
>> and none of them helps getting rid of red error icon on my project's
>> pom.xml which is well-formed and valid.
>>
>> Any help appreciated,
>> Borut
>>
>>
>> ------------------------------------------------------------------------
>> If this email is spam, report it here:
>> http://www.OnlyMyEmail.com/ReportSpam 
>> <http://www.OnlyMyEmail.com/reportSpam?Id=NjAxNzA6MjYxNTQxMzIwOmV1QG1kLnBwLnJ1>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Won't compile because of transitive dependency not finding its artifact

jholer
This post has NOT been accepted by the mailing list yet.
You need to set the Eclipse JVM to point to JDK. Open eclipse.ini and set the following lines

-vm
<full path to JDK (not jre) javaw.exe>

example:

-vm
C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe

This will resolve the issue of tools.jar.