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 via email to