从jenkins

时间:2018-01-10 16:59:00

标签: git maven jenkins nexus

我正试图在jenkins中对nexus执行maven释放。我收到错误无法读取密码' https://uname@github.developer.io':没有此类设备或地址。

我们有什么方法可以使用jenkins凭证并在scm连接配置中提及它?

以下是配置。

在Maven设置xml:

中添加了服务器
<servers>
   <server>
      <id>nexus</id>
      <username>admin</username>
      <password>admin</password>
   </server>
</servers>
pom xml中的

添加了以下内容:

<distributionManagement>
        <repository>
            <id>ADPNexus.Releases</id>
            <name>Nexus on ADP</name>
            <url>https://company-com/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <id>ADPNexus.Snapshots</id>
            <name>Nexus on ADP</name>
            <url>https://company-com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <scm>
    <connection>scm:git:https://uname:test@github.developer.io/company/esb-core.git</connection>
    <url>scm:git:https://uname:test@github.developer.io/company/esb-core.git</url>
    <developerConnection>scm:git:https://uname:test@github.developer.io/company/esb-core.git</developerConnection>
</scm>

jenkins工作配置:

Git配置:

提到存储库URL和要构建为* / master

的分支

构建目标

release:clean release:prepare release:perform

错误日志:

[INFO] [DEBUG] Goal:          org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <directory default-value="${project.build.directory}"/>
[INFO]   <excludeDefaultDirectories default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
[INFO]   <failOnError default-value="true">${maven.clean.failOnError}</failOnError>
[INFO]   <followSymLinks default-value="false">${clean.followSymLinks}</followSymLinks>
[INFO]   <outputDirectory default-value="${project.build.outputDirectory}"/>
[INFO]   <reportDirectory default-value="${project.reporting.outputDirectory}"/>
[INFO]   <retryOnError default-value="true">${maven.clean.retryOnError}</retryOnError>
[INFO]   <skip default-value="false">${clean.skip}</skip>
[INFO]   <testOutputDirectory default-value="${project.build.testOutputDirectory}"/>
[INFO]   <verbose>${clean.verbose}</verbose>
[INFO] </configuration>
[INFO] [DEBUG] =======================================================================
[INFO] [INFO] 
[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ core-parentnexustest ---
[INFO] [DEBUG] Using mirror AdpNexus (https://company-ca-nexus.dev.adp/repository/maven-public/) for apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository).
[INFO] [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=1, ConflictMarker.nodeCount=3, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=3, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=4, ConflictResolver.conflictItemCount=3, DefaultDependencyCollector.collectTime=36, DefaultDependencyCollector.transformTime=10}
[INFO] [DEBUG] org.apache.maven.plugins:maven-clean-plugin:jar:2.5:
[INFO] [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0:compile
[INFO] [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.5
[INFO] [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.5
[INFO] [DEBUG]   Imported:  < maven.api
[INFO] [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.5
[INFO] [DEBUG]   Included: org.apache.maven.plugins:maven-clean-plugin:jar:2.5
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0
[INFO] [DEBUG] Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.5:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.5, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[INFO] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.5:clean' with basic configurator -->
[INFO] [DEBUG]   (f) directory = /home/jenkins/workspace/TEST_NEXUS_RELEASE/target
[INFO] [DEBUG]   (f) excludeDefaultDirectories = false
[INFO] [DEBUG]   (f) failOnError = true
[INFO] [DEBUG]   (f) followSymLinks = false
[INFO] [DEBUG]   (f) outputDirectory = /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/classes
[INFO] [DEBUG]   (f) reportDirectory = /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/site
[INFO] [DEBUG]   (f) retryOnError = true
[INFO] [DEBUG]   (f) skip = false
[INFO] [DEBUG]   (f) testOutputDirectory = /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/test-classes
[INFO] [DEBUG] -- end configuration --
[INFO] [DEBUG] Skipping non-existing directory /home/jenkins/workspace/TEST_NEXUS_RELEASE/target
[INFO] [DEBUG] Skipping non-existing directory /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/classes
[INFO] [DEBUG] Skipping non-existing directory /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/test-classes
[INFO] [DEBUG] Skipping non-existing directory /home/jenkins/workspace/TEST_NEXUS_RELEASE/target/site
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 0.822 s
[INFO] [INFO] Finished at: 2018-01-10T19:03:15+01:00
[INFO] [INFO] Final Memory: 24M/1930M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git add -- pom.xml
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git rev-parse --show-toplevel
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git status --porcelain .
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[DEBUG] M  pom.xml
[DEBUG] ?? pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? pom.xml.releaseBackup
[DEBUG] ?? release.properties
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git commit --verbose -F /tmp/maven-scm-1947998640.commit pom.xml
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git symbolic-ref HEAD
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[INFO] Executing: /bin/sh -c cd /home/jenkins/workspace/TEST_NEXUS_RELEASE && git push https:********@github.developer.io/company/esb-core.git refs/heads/master:refs/heads/master
[INFO] Working directory: /home/jenkins/workspace/TEST_NEXUS_RELEASE
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.735 s
[INFO] Finished at: 2018-01-10T19:03:16+01:00
[INFO] Final Memory: 30M/1472M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project core-parentnexustest: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: could not read Password for 'https://uname@github.developer.io': No such device or address
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project core-parentnexustest: Unable to commit files
Provider message:
The git-push command failed.
Command output:
fatal: could not read Password for 'https://uname@github.developer.io': No such device or address

    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to commit files
Provider message:
The git-push command failed.
Command output:
fatal: could not read Password for 'https://uname@github.developer.io': No such device or address

    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:294)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:240)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 31 more
Caused by: org.apache.maven.shared.release.scm.ReleaseScmCommandException: Unable to commit files
Provider message:
The git-push command failed.
Command output:
fatal: could not read Password for 'https://uname@github.developer.io': No such device or address

    at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.checkin(AbstractScmCommitPhase.java:165)
    at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.performCheckins(AbstractScmCommitPhase.java:145)
    at org.apache.maven.shared.release.phase.ScmCommitPreparationPhase.runLogic(ScmCommitPreparationPhase.java:76)
    at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.execute(AbstractScmCommitPhase.java:78)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:286)
    ... 34 more
[ERROR] 
[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] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[JENKINS] Archiving /home/jenkins/workspace/TEST_NEXUS_RELEASE/pom.xml to com.company.esb.testnexus/core-parentnexustest/0.0.1-SNAPSHOT/core-parentnexustest-0.0.1-SNAPSHOT.pom

0 个答案:

没有答案