欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

maven deploy時報錯的解決方法

 更新時間:2020年09月07日 11:09:05   作者:趕路人兒  
這篇文章主要介紹了maven deploy時報錯的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

今天在發(fā)布maven工程的時候,很奇怪,因為在本地package,install等等都沒問題,但是打包的時候就是報錯,日志如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project courier-rapi: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project courier-rapi: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        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.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        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:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
        at org.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:235)
        at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
[ERROR]

如果對于maven不太熟悉的同學(xué)會很苦惱,仔細看日志我們會發(fā)現(xiàn)如下的信息:

repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter

意思是在pom文件中缺少distributionManagement標簽,或者缺少-DaltDeployementRepositoty,說的是缺少deploy的地址,maven不知道你想要deploy到哪里,在pom文件中增加如下信息,就發(fā)布成功了.

<distributionManagement>
    <repository>
      <id>nexus</id>
      <name>releases</name>
      <url>http://mvn2.qdingnet.com/nexus/content/repositories/releases</url>
      <uniqueVersion>true</uniqueVersion>
    </repository>
    <snapshotRepository>
      <id>nexus</id>
      <name>snapshots</name>
      <url>http://XXXXXXXXXXXXX/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

為了補充知識,下面講解一下關(guān)于distributionManagement及其配置的信息.

用于配置分發(fā)管理,配置相應(yīng)的產(chǎn)品發(fā)布信息,主要用于發(fā)布,在執(zhí)行mvn deploy后表示要發(fā)布的位置,下面時幾種配置形式.

配置到文件系統(tǒng)

<distributionManagement>
  <repository>
    <id>proficio-repository</id>
    <name>Proficio Repository</name>
    <url>file://${basedir}/target/deploy</url>
  </repository>
</distributionManagement>

使用ssh2配置

<distributionManagement>
  <repository>
    <id>proficio-repository</id>
    <name>Proficio Repository</name>
    <url>scp://sshserver.yourcompany.com/deploy</url>
  </repository>
</distributionManagement>

使用sftp配置

<distributionManagement>
  <repository>
    <id>proficio-repository</id>
    <name>Proficio Repository</name>
    <url>sftp://ftpserver.yourcompany.com/deploy</url>
  </repository>
</distributionManagement>

使用外在的ssh配置

<distributionManagement>
  <repository>
    <id>proficio-repository</id>
    <name>Proficio Repository</name>
    <url>scpexe://sshserver.yourcompany.com/deploy</url>
  </repository>
</distributionManagement>
<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-ssh-external</artifactId>
      <version>1.0-alpha-6</version>
    </extension>
  </extensions>
</build>

使用ftp配置

<distributionManagement>
  <repository>
    <id>proficio-repository</id>
    <name>Proficio Repository</name>
    <url>ftp://ftpserver.yourcompany.com/deploy</url>
  </repository>
</distributionManagement>
<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-ftp</artifactId>
      <version>1.0-alpha-6</version>
    </extension>
  </extensions>
</build>

到此這篇關(guān)于maven deploy時報錯的解決方法的文章就介紹到這了,更多相關(guān)maven deploy報錯內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Java中數(shù)據(jù)庫常用的兩把鎖之樂觀鎖和悲觀鎖

    Java中數(shù)據(jù)庫常用的兩把鎖之樂觀鎖和悲觀鎖

    這篇文章主要介紹了數(shù)據(jù)庫常用的兩把鎖之樂觀鎖和悲觀鎖,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • Java多線程 ReentrantReadWriteLock原理及實例詳解

    Java多線程 ReentrantReadWriteLock原理及實例詳解

    這篇文章主要介紹了Java多線程 ReentrantReadWriteLock原理及實例詳解,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-09-09
  • java中幾種http請求方式示例詳解

    java中幾種http請求方式示例詳解

    在日常工作和學(xué)習(xí)中有很多地方都需要發(fā)送HTTP請求,下面這篇文章主要給大家介紹了關(guān)于java中幾種http請求方式的相關(guān)資料,文中通過代碼介紹的非常詳細,需要的朋友可以參考下
    2023-11-11
  • java中的編碼轉(zhuǎn)換過程(以utf8和gbk為例)

    java中的編碼轉(zhuǎn)換過程(以utf8和gbk為例)

    這篇文章主要介紹了java中的編碼轉(zhuǎn)換過程(以utf8和gbk為例),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • MyBatis獲取自動生成的(主)鍵值的方法

    MyBatis獲取自動生成的(主)鍵值的方法

    本文主要介紹了MyBatis獲取自動生成的(主)鍵值的方法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-04-04
  • Maven中央倉庫地址配置大全

    Maven中央倉庫地址配置大全

    這篇文章主要介紹了Maven中央倉庫地址配置大全,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06
  • Spring框架基于AOP實現(xiàn)簡單日志管理步驟解析

    Spring框架基于AOP實現(xiàn)簡單日志管理步驟解析

    這篇文章主要介紹了Spring框架基于AOP實現(xiàn)簡單日志管理步驟解析,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-06-06
  • SpringMVC返回的ResponseEntity出現(xiàn)亂碼及解決

    SpringMVC返回的ResponseEntity出現(xiàn)亂碼及解決

    這篇文章主要介紹了SpringMVC返回的ResponseEntity出現(xiàn)亂碼及解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-02-02
  • java io讀取文件操作代碼實例

    java io讀取文件操作代碼實例

    這篇文章主要介紹了java io讀取文件操作代碼實例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-11-11
  • Spring Cloud Gateway 獲取請求體(Request Body)的多種方法

    Spring Cloud Gateway 獲取請求體(Request Body)的多種方法

    這篇文章主要介紹了Spring Cloud Gateway 獲取請求體(Request Body)的多種方法,本文通過實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-01-01

最新評論