/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/wecash/o2o/o2o-dubbo-contract "-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=52680:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.1 -s /Users/wecash/Desktop/settings.xml deploy -f pom.xml
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] o2o-dubbo-contract
[INFO] o2o-dubbo-contract-core
[INFO] o2o-dubbo-contract-provider
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building o2o-dubbo-contract 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.8.RELEASE:repackage (repackage) @ o2o-dubbo-contract ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ o2o-dubbo-contract ---
[INFO] Installing /Users/wecash/o2o/o2o-dubbo-contract/pom.xml to /Users/wecash/.m2/repository/net/wecash/o2o-dubbo-contract/1.0.0-SNAPSHOT/o2o-dubbo-contract-1.0.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ o2o-dubbo-contract ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] o2o-dubbo-contract ................................. FAILURE [ 0.695 s]
[INFO] o2o-dubbo-contract-core ............................ SKIPPED
[INFO] o2o-dubbo-contract-provider ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.175 s
[INFO] Finished at: 2019-09-23T15:47:22+08:00
[INFO] Final Memory: 22M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project o2o-dubbo-contract: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/MojoExecutionExceptionProcess finished with exit code 1
解决方案:
在pom文件中定义maven私服的地址
<distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>https://repo.wecash.net/repository/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>https://repo.wecash.net/repository/snapshots/</url> </snapshotRepository> </distributionManagement>
参考:
You should include the repository where you want to deploy in the distribution management section of the pom.xml
.
Example:
<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/xsd/maven-4.0.0.xsd">
...
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>corp1</id>
<name>Corporate Repository</name>
<url>scp://repo/maven2</url>
<layout>default</layout>
</repository>
...
</distributionManagement>
...
</project>