我正在尝试使用mvn jboss-as:start命令启动一个jboss-as服务器,并简单地说它不会运行。
http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start (default-cli) on project thenaglecode: Execution default-cli of goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start failed: A required class was missing while executing org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start: org/sonatype/aether/resolution/ArtifactResolutionException
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/jxnagl/.m2/repository/org/jboss/as/plugins/jboss-as-maven-plugin/7.4.Final/jboss-as-maven-plugin-7.4.Final.jar
[ERROR] urls[1] = file:/C:/Users/jxnagl/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
...
[ERROR] urls[33] = file:/C:/Users/jxnagl/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
[ERROR] urls[34] = file:/C:/Users/jxnagl/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.sonatype.aether.resolution.ArtifactResolutionException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
此链接:跟踪底部上方错误日志中的“[Help 1]”表示此问题非常新,不超过一天。
然而,页面对我来说并不是很有用,也许是因为我对maven不熟悉所以请对我好,即我无法弄清楚哪种依赖失败。这是我的 pom.xml 供您阅读,原谅了对物业的过度杀伤,我将尽快恢复这种做法。
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thenaglecode</groupId>
<artifactId>thenaglecode</artifactId>
<packaging>pom</packaging>
<version>1.0.0.Pre-Alpha</version>
<modules>
<module>core</module>
<module>algorithms</module>
<module>web</module>
<module>testing</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- the nagle code properties -->
<thenaglecode.java.compiler.version>1.7</thenaglecode.java.compiler.version>
<thenaglecode.java.home>C:\Program Files\Java\jdk1.7.0_25</thenaglecode.java.home>
<thenaglecode.version>1.0.0.Pre-Alpha</thenaglecode.version>
<!-- third party library versions format: "libraries.version.<groupid>.<artifactid>" -->
<libraries.version.org.jboss.spec.jboss-javaee-6.0>3.0.2.Final
</libraries.version.org.jboss.spec.jboss-javaee-6.0>
<libraries.version.org.jboss.spec.jboss-javaee-all-6.0>3.0.2.Final
</libraries.version.org.jboss.spec.jboss-javaee-all-6.0>
<libraries.version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final
</libraries.version.org.jboss.as.jboss-as-arquillian-container-remote>
<libraries.version.org.jboss.arqullian.protocol.arquillian-protocol-servlet>1.1.0.Final
</libraries.version.org.jboss.arqullian.protocol.arquillian-protocol-servlet>
<libraries.version.org.jboss.weld.weld-api>2.0.Final</libraries.version.org.jboss.weld.weld-api>
<libraries.version.org.jboss.arquillian.container.arquillian-glassfish-remote-3.1>1.0.0.CR4
</libraries.version.org.jboss.arquillian.container.arquillian-glassfish-remote-3.1>
<libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec>1.0.3.Final
</libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec>
<libraries.version.org.jboss.arquillian.arquillian-bom>1.1.1.Final
</libraries.version.org.jboss.arquillian.arquillian-bom>
<libraries.version.xalan.xalan>2.7.1</libraries.version.xalan.xalan>
<libraries.version.joda-time.joda-time>2.2</libraries.version.joda-time.joda-time>
<libraries.version.junit.junit>4.11</libraries.version.junit.junit>
<libraries.version.org.apache.commons.commons-lang3>3.1</libraries.version.org.apache.commons.commons-lang3>
<libraries.version.commons-collections.commons-collections>3.2.1</libraries.version.commons-collections.commons-collections>
<libraries.version.commons-io.commons-io>2.4</libraries.version.commons-io.commons-io>
<!-- plugins format: "plugins.version.<groupid>.<artifactid>" -->
<plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>7.4.Final</plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>
<plugins.version.org.apache.maven.plugins.maven-compiler-plugin>3.1</plugins.version.org.apache.maven.plugins.maven-compiler-plugin>
<plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>7.4.Final</plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>
</properties>
<dependencyManagement>
<dependencies>
<!-- thenaglecode projects -->
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>core</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>web</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>algorithms</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<!-- third party libraries -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${libraries.version.org.jboss.arquillian.arquillian-bom}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-all-6.0</artifactId>
<version>${libraries.version.org.jboss.spec.jboss-javaee-all-6.0}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${libraries.version.org.apache.commons.commons-lang3}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${libraries.version.commons-collections.commons-collections}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${libraries.version.commons-io.commons-io}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${libraries.version.junit.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet.jstl</groupId>
<artifactId>jboss-jstl-api_1.2_spec</artifactId>
<version>${libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec}</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>${libraries.version.xalan.xalan}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${libraries.version.joda-time.joda-time}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugins.version.org.apache.maven.plugins.maven-compiler-plugin}</version>
<configuration>
<source>${thenaglecode.java.compiler.version}</source>
<target>${thenaglecode.java.compiler.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
<configuration>
<javaHome>${thenaglecode.java.home}</javaHome>
<execute-commands/>
<executeCommands/>
</configuration>
</plugin>
</plugins>
</build>
</project>
答案 0 :(得分:3)
使用Maven 3.1,他们转而使用eclipse以太网。 jboss-as-maven-plugin使用Sonatype以太,就像Maven 3.0.x使用的那样。这两个版本不兼容,这意味着需要两个不同的插件。一个用于Maven 3.1,一个用于Maven 3.0.x。
正如您所见,一个注意事项是,这只会影响跑步和开始目标。它没有解决方法。你必须使用Maven 3.0.x,直到发布了支持eclipse以太的jboss-as-maven-plugin版本。
答案 1 :(得分:1)
据我所知this bug report:jboss-as-maven-plugin
在不兼容的 maven插件(dependency-plugin和enforcer-plugin)上有2个dependencies。
作为一种解决方法,我会尝试以下方法:override incompatible dependencies已知兼容的新版本(listed here)。为此:更改您的pom.xml并为jboss-as-maven-plugin
添加以下依赖项(即不是您的项目依赖项)
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
<configuration>
<javaHome>${thenaglecode.java.home}</javaHome>
<execute-commands/>
<executeCommands/>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version> <!--override 2.6-->
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3</version> <!--override 1.2-->
</dependency>
</dependencies>
</plugin>