我正在尝试在 pre(和 post)-integration-test 阶段使用 jboss-as-maven-plugin 来部署(和取消部署)我的测试 webapp,并且当执行 mvn install 时,(取消)部署不会发生。以下 Jenkins 作业的输出似乎指向我的配置,但我无法弄清楚缺少什么:
行家输出:
mojoSucceeded org.apache.maven.plugins:maven-jar-plugin:2.3.2(default-jar)
forkedProjectSucceeded com.hck.debate:debate-test:2.1.15-SNAPSHOT
Dec 3, 2012 11:28:19 PM hudson.maven.ExecutedMojo <init>
WARNING: Failed to getClass for org.jboss.as.plugin.deployment.Deploy
mojoStarted org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final(set-env)
[INFO]
[INFO] --- jboss-as-maven-plugin:7.2.Final:deploy (set-env) @ debate-test ---
Dec 3, 2012 11:28:20 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Dec 3, 2012 11:28:20 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Dec 3, 2012 11:28:20 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.7.GA
mojoSucceeded org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final(set-env)
mojoStarted org.apache.maven.plugins:maven-failsafe-plugin:2.12.4(default)
调试模式下的 maven 输出(mvn -X install):
mojoSucceeded org.apache.maven.plugins:maven-jar-plugin:2.3.2(default-jar)
forkedProjectSucceeded com.hck.debate:debate-test:2.1.16-SNAPSHOT
Dec 4, 2012 6:00:45 PM hudson.maven.ExecutedMojo <init>
WARNING: Failed to getClass for org.jboss.as.plugin.deployment.Deploy
mojoStarted org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final(set-env)
[INFO]
[INFO] --- jboss-as-maven-plugin:7.2.Final:deploy (set-env) @ debate-test ---
[DEBUG] org.jboss.as.plugins:jboss-as-maven-plugin:jar:7.2.Final:
[DEBUG] org.apache.maven:maven-plugin-api:jar:3.0.4:compile
[DEBUG] org.apache.maven:maven-model:jar:3.0.4:compile
[DEBUG] org.apache.maven:maven-artifact:jar:3.0.4:compile
[DEBUG] org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG] org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[DEBUG] org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG] org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG] org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[DEBUG] org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG] backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.sonatype.aether:aether-api:jar:1.8:compile
[DEBUG] org.sonatype.aether:aether-util:jar:1.8:compile
[DEBUG] org.jboss.as:jboss-as-cli:jar:7.1.2.Final:compile
[DEBUG] jline:jline:jar:0.9.94:compile
[DEBUG] org.jboss:staxmapper:jar:1.1.0.Final:compile
[DEBUG] org.jboss.logging:jboss-logging:jar:3.1.1.GA:compile
[DEBUG] org.jboss.sasl:jboss-sasl:jar:1.0.1.Final:compile
[DEBUG] org.jboss.remoting3:jboss-remoting:jar:3.2.7.GA:compile
[DEBUG] org.jboss.xnio:xnio-api:jar:3.0.3.GA:compile
[DEBUG] org.jboss.as:jboss-as-controller:jar:7.1.2.Final:compile
[DEBUG] org.jboss.modules:jboss-modules:jar:1.1.2.GA:compile
[DEBUG] org.jboss.msc:jboss-msc:jar:1.0.2.GA:compile
[DEBUG] org.jboss.remotingjmx:remoting-jmx:jar:1.0.3.Final:compile
[DEBUG] org.jboss.logmanager:jboss-logmanager:jar:1.3.0.Final:compile
[DEBUG] org.jboss.logging:jboss-logging-processor:jar:1.0.2.Final:compile
[DEBUG] system:jdk-tools:jar:jdk:system
[DEBUG] org.jboss.marshalling:jboss-marshalling:jar:1.3.14.GA:compile
[DEBUG] org.jboss.marshalling:jboss-marshalling-river:jar:1.3.14.GA:compile
[DEBUG] org.jboss.xnio:xnio-nio:jar:3.0.3.GA:compile
[DEBUG] org.jboss:jboss-vfs:jar:3.1.0.Final:compile
[DEBUG] sun.jdk:jconsole:jar:jdk:system
[DEBUG] org.jboss.as:jboss-as-build-config:jar:7.1.2.Final:compile
[DEBUG] org.jboss.as:jboss-as-controller-client:jar:7.1.2.Final:compile
[DEBUG] org.jboss.as:jboss-as-protocol:jar:7.1.2.Final:compile
[DEBUG] org.jboss:jboss-dmr:jar:1.1.1.Final:compile
[DEBUG] org.jboss.threads:jboss-threads:jar:2.0.0.GA:compile
[DEBUG] org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:3.0.1:compile
[DEBUG] Created new class realm plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final
[DEBUG] Importing foreign packages into class realm plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final
[DEBUG] Included: org.jboss.as.plugins:jboss-as-maven-plugin:jar:7.2.Final
[DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG] Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
[DEBUG] Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG] Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
[DEBUG] Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.sonatype.aether:aether-util:jar:1.8
[DEBUG] Included: org.jboss.as:jboss-as-cli:jar:7.1.2.Final
[DEBUG] Included: jline:jline:jar:0.9.94
[DEBUG] Included: org.jboss:staxmapper:jar:1.1.0.Final
[DEBUG] Included: org.jboss.logging:jboss-logging:jar:3.1.1.GA
[DEBUG] Included: org.jboss.sasl:jboss-sasl:jar:1.0.1.Final
[DEBUG] Included: org.jboss.remoting3:jboss-remoting:jar:3.2.7.GA
[DEBUG] Included: org.jboss.xnio:xnio-api:jar:3.0.3.GA
[DEBUG] Included: org.jboss.as:jboss-as-controller:jar:7.1.2.Final
[DEBUG] Included: org.jboss.modules:jboss-modules:jar:1.1.2.GA
[DEBUG] Included: org.jboss.msc:jboss-msc:jar:1.0.2.GA
[DEBUG] Included: org.jboss.remotingjmx:remoting-jmx:jar:1.0.3.Final
[DEBUG] Included: org.jboss.logmanager:jboss-logmanager:jar:1.3.0.Final
[DEBUG] Included: org.jboss.logging:jboss-logging-processor:jar:1.0.2.Final
[DEBUG] Included: system:jdk-tools:jar:jdk
[DEBUG] Included: org.jboss.marshalling:jboss-marshalling:jar:1.3.14.GA
[DEBUG] Included: org.jboss.marshalling:jboss-marshalling-river:jar:1.3.14.GA
[DEBUG] Included: org.jboss.xnio:xnio-nio:jar:3.0.3.GA
[DEBUG] Included: org.jboss:jboss-vfs:jar:3.1.0.Final
[DEBUG] Included: sun.jdk:jconsole:jar:jdk
[DEBUG] Included: org.jboss.as:jboss-as-build-config:jar:7.1.2.Final
[DEBUG] Included: org.jboss.as:jboss-as-controller-client:jar:7.1.2.Final
[DEBUG] Included: org.jboss.as:jboss-as-protocol:jar:7.1.2.Final
[DEBUG] Included: org.jboss:jboss-dmr:jar:1.1.1.Final
[DEBUG] Included: org.jboss.threads:jboss-threads:jar:2.0.0.GA
[DEBUG] Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.1
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:3.0.4
[DEBUG] Excluded: org.apache.maven:maven-model:jar:3.0.4
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:3.0.4
[DEBUG] Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0
[DEBUG] Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.4
[DEBUG] Excluded: org.apache.maven:maven-project:jar:2.2.1
[DEBUG] Excluded: org.apache.maven:maven-settings:jar:2.2.1
[DEBUG] Excluded: org.apache.maven:maven-profile:jar:2.2.1
[DEBUG] Excluded: org.apache.maven:maven-artifact-manager:jar:2.2.1
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:2.2.1
[DEBUG] Excluded: org.apache.maven:maven-plugin-registry:jar:2.2.1
[DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG] Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG] Excluded: org.sonatype.aether:aether-api:jar:1.8
[DEBUG] Configuring mojo org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final:deploy from plugin realm ClassRealm[plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final, parent: sun.misc.Launcher$AppClassLoader@cac268]
[DEBUG] Configuring mojo 'org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final:deploy' with basic configurator -->
[DEBUG] (f) checkPackaging = true
[DEBUG] (f) force = true
[DEBUG] (f) hostname = 10.10.101.84
[DEBUG] (f) port = 9999
[DEBUG] (f) project = MavenProject: com.hck.debate:debate-test:2.1.16-SNAPSHOT @ /var/lib/jenkins/jobs/sauce-dev/workspace/debate-test/pom.xml
[DEBUG] (f) skip = false
[DEBUG] (f) targetDir = /var/lib/jenkins/jobs/sauce-dev/workspace/debate-test/target
[DEBUG] -- end configuration --
Dec 4, 2012 6:00:46 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Dec 4, 2012 6:00:46 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Dec 4, 2012 6:00:46 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.7.GA
[DEBUG] Executing deployment
mojoSucceeded org.jboss.as.plugins:jboss-as-maven-plugin:7.2.Final(set-env)
mojoStarted org.apache.maven.plugins:maven-failsafe-plugin:2.12.4(default)
我的 pom 文件:
<build>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.2.Final</version>
<configuration>
<hostname>10.10.101.84</hostname>
<port>9999</port>
</configuration>
<executions>
<execution>
<id>set-env</id>
<phase>pre-integration-test</phase>
<configuration>
<force>true</force>
</configuration>
<goals>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>unset-env</id>
<phase>post-integration-test</phase>
<goals>
<goal>undeploy</goal>
</goals>
</execution>
</executions>
<plugin>
</plugins>
</build>
有什么线索吗?
编辑:我认为我在这里有一个更大的问题,因为 jboss-as-maven-plugin 执行是在测试模块中完成的(上面的 pom 文件是测试模块的文件)所以它尝试部署测试模块 jar(我想部署战争,这是另一个模块)...