无法在Jenkins上部署maven项目

时间:2017-04-05 11:56:09

标签: maven java-ee jenkins wildfly artifactory

我尝试使用Jenkins,Wildfly和Artifactory部署我的JavaEE Maven Web项目,我对这些东西很新,这是学校作业的一部分。

项目本身运行/构建正常,如果我尝试在Jenkins上构建它而不部署它,它也很好。但是当我尝试部署它时,我收到一条我不理解的错误消息,所以我希望这里有人可以用它来制作一些东西。

这是错误:

[Error] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4:deploy (default) on project kwetter: Execution default of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4:deploy failed: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.yaml:snakeyaml:jar:1.13, org.jboss.msc:jboss-msc:jar:1.2.7.SP1, org.jboss.remotingjmx:remoting-jmx:jar:3.0.0.Beta3, org.wildfly.core:wildfly-controller-client:jar:3.0.0.Beta5: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4:deploy (default) on project kwetter: Execution default of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4:deploy failed: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.yaml:snakeyaml:jar:1.13, org.jboss.msc:jboss-msc:jar:1.2.7.SP1, org.jboss.remotingjmx:remoting-jmx:jar:3.0.0.Beta3, org.wildfly.core:wildfly-controller-client:jar:3.0.0.Beta5: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
        at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
        at hudson.remoting.UserRequest.perform(UserRequest.java:153)
        at hudson.remoting.UserRequest.perform(UserRequest.java:50)
        at hudson.remoting.Request$2.run(Request.java:336)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4:deploy failed: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.yaml:snakeyaml:jar:1.13, org.jboss.msc:jboss-msc:jar:1.2.7.SP1, org.jboss.remotingjmx:remoting-jmx:jar:3.0.0.Beta3, org.wildfly.core:wildfly-controller-client:jar:3.0.0.Beta5: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 31 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.2.0.Alpha4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.yaml:snakeyaml:jar:1.13, org.jboss.msc:jboss-msc:jar:1.2.7.SP1, org.jboss.remotingjmx:remoting-jmx:jar:3.0.0.Beta3, org.wildfly.core:wildfly-controller-client:jar:3.0.0.Beta5: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal(DefaultPluginDependenciesResolver.java:218)
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:149)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:400)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:372)
        at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:231)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:102)
        ... 32 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.yaml:snakeyaml:jar:1.13, org.jboss.msc:jboss-msc:jar:1.2.7.SP1, org.jboss.remotingjmx:remoting-jmx:jar:3.0.0.Beta3, org.wildfly.core:wildfly-controller-client:jar:3.0.0.Beta5: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseArtifactResolver.resolveArtifacts(ArtifactoryEclipseArtifactResolver.java:56)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal(DefaultPluginDependenciesResolver.java:210)
        ... 37 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 in http://localhost:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-release has elapsed or updates are forced
        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 41 more

这是我的pom文件:

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mitchell.jea6</groupId>
<artifactId>kwetter</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>kwetter Maven Webapp</name>
<url>http://maven.apache.org</url>

<dependencies>
  <dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>7.0</version>
  </dependency>
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>RELEASE</version>
  </dependency>
  <dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-all</artifactId>
    <version>1.10.19</version>
  </dependency>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>5.1.0.Final</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>6.0.5</version>
  </dependency>
  <dependency>
    <groupId>com.jayway.restassured</groupId>
    <artifactId>rest-assured</artifactId>
    <version>2.9.0</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.2.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>net.bootsfaces</groupId>
    <artifactId>bootsfaces</artifactId>
    <version>0.8.0</version>
    <scope>compile</scope>
  </dependency>
  <!-- https://mvnrepository.com/artifact/javax.batch/javax.batch-api -->
  <dependency>
    <groupId>javax.batch</groupId>
    <artifactId>javax.batch-api</artifactId>
    <version>1.0.1</version>
  </dependency>

  <dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
    <version>2.6.1</version>
  </dependency>

</dependencies>

<build>
  <finalName>kwetter</finalName>
  <plugins>
    <plugin>
      <groupId>org.wildfly.plugins</groupId>
      <artifactId>wildfly-maven-plugin</artifactId>
      <version>1.2.0.Alpha4</version>
      <configuration>
        <hostname>hostname</hostname>
        <port>port</port>
        <username>username</username>
        <password>password</password>
        <name>kwetter.war</name>
      </configuration>
      <executions>
        <execution>
          <phase>install</phase>
          <goals>
            <goal>deploy</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
</project>

出于隐私原因,我仅使用wordshostname / port / username / password替换了真实的主机名/端口/用户名/密码

0 个答案:

没有答案