Maven дает ошибку с Spring Roo

Изначально у меня был установлен x64-битный java sdk и x64-битный STS.

Но затем я вижу эту весеннюю ссылку на проблему

2) для второй зависимости я пробовал это, но та же проблема

Затем я снова установил x86 sdk и x86 STS, но проблема все еще существует. что я должен делать . Я изменил JAVA_HOME НА НОВЫЙ sdk.

ошибка ниже

Мне нужно добавить что-то в переменную PATH

Missing:
----------
1) com.sun:tools:jar:1.4.2

  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.4.2 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
    2) com.sun:tools:jar:1.4.2

----------
1 required artifact is missing.

for artifact: 
  org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0

from the specified remote repositories:
  spring-maven-milestone (http://maven.springframework.org/milestone),
  central (http://repo1.maven.org/maven2),
  spring-roo-repository (http://spring-roo-repository.springsource.org/release),
  codehaus.org (http://repository.codehaus.org),
  spring-maven-release (http://maven.springframework.org/release),
  snapshots (http://snapshots.repository.codehaus.org),
  JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases)



[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Missing:
----------
1) com.sun:tools:jar:1.4.2

  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.4.2 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
    2) com.sun:tools:jar:1.4.2

----------
1 required artifact is missing.

for artifact: 
  org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0

from the specified remote repositories:
  spring-maven-milestone (http://maven.springframework.org/milestone),
  central (http://repo1.maven.org/maven2),
  spring-roo-repository (http://spring-roo-repository.springsource.org/release),
  codehaus.org (http://repository.codehaus.org),
  spring-maven-release (http://maven.springframework.org/release),
  snapshots (http://snapshots.repository.codehaus.org),
  JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases)


    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) com.sun:tools:jar:1.4.2

  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.4.2 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
    2) com.sun:tools:jar:1.4.2

----------
1 required artifact is missing.

for artifact: 
  org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0

from the specified remote repositories:
  spring-maven-milestone (http://maven.springframework.org/milestone),
  central (http://repo1.maven.org/maven2),
  spring-roo-repository (http://spring-roo-repository.springsource.org/release),
  codehaus.org (http://repository.codehaus.org),
  spring-maven-release (http://maven.springframework.org/release),
  snapshots (http://snapshots.repository.codehaus.org),
  JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases)


    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:360)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:304)
    at org.apache.maven.plugin.DefaultPluginManager.ensurePluginContainerIsComplete(DefaultPluginManager.java:835)
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:647)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Feb 08 02:10:36 CST 2011
[INFO] Final Memory: 17M/42M
[INFO] ----------------------------

person Community    schedule 07.02.2011    source источник
comment
проблема с родным братом, возможно, stackoverflow.com/questions/3356716/   -  person Nishant    schedule 08.02.2011


Ответы (2)


Думаю, есть несколько способов решить эту проблему. Однако вы можете определить профиль, который определяет зависимость от tools.jar:

...
  <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.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  ...
person Lukasz    schedule 07.02.2011
comment
Я новичок в этой зависимости, где я могу вставить приведенный выше код, я имею в виду, в каком файле - person ; 08.02.2011
comment
Я пробовал, но результат тот же. Я видел, что tools.jar находится в borth x32 и x64 sdk. Я думаю, что они исправили это, но я все еще получаю ту же ошибку. - person ; 08.02.2011

Предполагая, что у вас установлены версии JDK для x64 и x86, одна из возможностей состоит в том, что STS все еще использует версию x64.

person Raghuram    schedule 08.02.2011