maven deploy时报错的解决方法
今天在发布maven工程的时候,很奇怪,因为在本地package,install等等都没问题,但是打包的时候就是报错,日志如下:
[ERROR]Failedtoexecutegoalorg.apache.maven.plugins:maven-deploy-plugin:2.7:deploy(default-deploy)onprojectcourier-rapi:Deploymentfailed:repositoryelementwasnotspecifiedinthePOMinsidedistributionManagementelementorin-DaltDeploymentRepository=id::layout::urlparameter->[Help1]
org.apache.maven.lifecycle.LifecycleExecutionException:Failedtoexecutegoalorg.apache.maven.plugins:maven-deploy-plugin:2.7:deploy(default-deploy)onprojectcourier-rapi:Deploymentfailed:repositoryelementwasnotspecifiedinthePOMinsidedistributionManagementelementorin-DaltDeploymentRepository=id::layout::urlparameter
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
atorg.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
atorg.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
atorg.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
atorg.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
atorg.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
atorg.apache.maven.cli.MavenCli.main(MavenCli.java:197)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
atjava.lang.reflect.Method.invoke(Method.java:497)
atorg.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
atorg.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
atorg.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
atorg.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Causedby:org.apache.maven.plugin.MojoExecutionException:Deploymentfailed:repositoryelementwasnotspecifiedinthePOMinsidedistributionManagementelementorin-DaltDeploymentRepository=id::layout::urlparameter
atorg.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:235)
atorg.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118)
atorg.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
...20more
[ERROR]
如果对于maven不太熟悉的同学会很苦恼,仔细看日志我们会发现如下的信息:
repositoryelementwasnotspecifiedinthePOMinsidedistributionManagementelementorin-DaltDeploymentRepository=id::layout::urlparameter
意思是在pom文件中缺少distributionManagement标签,或者缺少-DaltDeployementRepositoty,说的是缺少deploy的地址,maven不知道你想要deploy到哪里,在pom文件中增加如下信息,就发布成功了.
nexus releases http://mvn2.qdingnet.com/nexus/content/repositories/releases true nexus snapshots http://XXXXXXXXXXXXX/nexus/content/repositories/snapshots
为了补充知识,下面讲解一下关于distributionManagement及其配置的信息.
用于配置分发管理,配置相应的产品发布信息,主要用于发布,在执行mvndeploy后表示要发布的位置,下面时几种配置形式.
配置到文件系统
proficio-repository ProficioRepository file://${basedir}/target/deploy
使用ssh2配置
proficio-repository ProficioRepository scp://sshserver.yourcompany.com/deploy
使用sftp配置
proficio-repository ProficioRepository sftp://ftpserver.yourcompany.com/deploy
使用外在的ssh配置
proficio-repository ProficioRepository scpexe://sshserver.yourcompany.com/deploy org.apache.maven.wagon wagon-ssh-external 1.0-alpha-6
使用ftp配置
proficio-repository ProficioRepository ftp://ftpserver.yourcompany.com/deploy org.apache.maven.wagon wagon-ftp 1.0-alpha-6
到此这篇关于mavendeploy时报错的解决方法的文章就介绍到这了,更多相关mavendeploy报错内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。