Maven使用bamboo

时间:2017-02-09 03:20:31

标签: java maven deployment bamboo continuous-deployment

我想使用Bamboo将构建文件(格式* .cba)部署到nexus存储库。此构建文件由ANT生成。我正在使用没有pom文件的maven deploy命令作为舞台中的竹子任务。下面的命令。

构建文件*.cba是一个共享工件。

-X deploy:deploy-file 
-Dfile=${bamboo.artifacts.path.buildFile}
-Dpackaging=cba
-Durl=https://nexus.internal.organisation.com/content/repositories/snapshots/
-DrepositoryId=snapshots
-DgroupId=com.organisation.art
-DartifactId=myproject
-Dversion=0.0.1-SNAPSHOT

当Bamboo运行此命令时,我总是收到此错误。

  

[INFO]正在下载:https://nexus.internal.organisation.com/content/repositories/art-snapshots/com/organisation/art/myproject/0.0.1-SNAPSHOT/maven-metadata.xml   [警告]无法将元数据com.organisation.art:myproject:0.0.1-SNAPSHOT/maven-metadata.xml从/向art-snapshots(https://nexus.internal.organisation.com/content/repositories/art-snapshots/)传输:/ home / art / username / work / SILF /.m2/repository/com/organisation/art/myproject/0.0.1-SNAPSHOT/maven-metadata-art-snapshots.xml.part.lock(没有这样的文件或目录)   org.eclipse.aether.transfer.MetadataTransferException:无法将元数据com.organisation.art:myproject:0.0.1-SNAPSHOT/maven-metadata.xml从/向art-snapshots(https://nexus.internal.organisation.com/content/repositories/art-snapshots/)传输:/ home / art / username / work / SILF / .m2 / repository / com / organization / art / myproject / 0.0.1-SNAPSHOT / maven-metadata-art-snapshots.xml.part.lock(没有这样的文件或目录)       at org.eclipse.aether.connector.basic.MetadataTransportListener.transferFailed(MetadataTransportListener.java:43)       at org.eclipse.aether.connector.basic.BasicRepositoryConnector $ TaskRunner.run(BasicRepositoryConnector.java:355)       在org.eclipse.aether.util.concurrency.RunnableErrorForwarder $ 1.run(RunnableErrorForwarder.java:67)       at org.eclipse.aether.connector.basic.BasicRepositoryConnector $ DirectExecutor.execute(BasicRepositoryConnector.java:581)       at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:222)       在org.eclipse.aether.internal.impl.DefaultDeployer.upload(DefaultDeployer.java:417)       在org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:290)       在org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)       在org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)       在org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)       在org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)       在org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:310)       在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)       在org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)       在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)       在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)       在org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)       在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)       在org.apache.maven.cli.MavenCli.main(MavenCli.java:199)       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)       在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)       在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)       在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)       在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)   引起:java.io.FileNotFoundException:/home/art/username/work/SILF/.m2/repository/com/organisation/art/myproject/0.0.1-SNAPSHOT/maven-metadata-art-snapshots.xml.part .lock(没有这样的文件或目录)       在java.io.RandomAccessFile.open0(本机方法)       在java.io.RandomAccessFile.open(RandomAccessFile.java:316)       在java.io.RandomAccessFile。(RandomAccessFile.java:243)       在org.eclipse.aether.connector.basic.PartialFile $ LockFile.tryLock(PartialFile.java:123)       在org.eclipse.aether.connector.basic.PartialFile $ LockFile.lock(PartialFile.java:71)       在org.eclipse.aether.connector.basic.PartialFile $ LockFile。(PartialFile.java:58)       在org.eclipse.aether.connector.basic.PartialFile $ Factory.newInstance(PartialFile.java:210)       at org.eclipse.aether.connector.basic.BasicRepositoryConnector $ GetTaskRunner.runTask(BasicRepositoryConnector.java:432)       at org.eclipse.aether.connector.basic.BasicRepositoryConnector $ TaskRunner.run(BasicRepositoryConnector.java:350)       ......还有32个

我认为版本控制存在一些问题。有什么帮助吗?

2 个答案:

答案 0 :(得分:0)

cba AFAIK不是有效的包装价值,请参阅"包装":

https://maven.apache.org/pom.html

也许你最好通过压缩脚本并使用包装" zip"进行部署。

答案 1 :(得分:0)

我可以使用以下命令解决此问题。希望这会有所帮助。

mvn deploy:deploy-file 
-Dfile=${bamboo.artifacts.path.cbaFile} 
-Dpackaging=cba 
-DgeneratePom=false 
-DupdateReleaseInfo=true 
-Durl=https://nexus.organisation.com/content/repositories/snapshots  
-DrepositoryId=snapshots  
-DgroupId=com.organisation.dept 
-DartifactId=myproject 
-Dversion=0.0.1-SNAPSHOT