簡體   English   中英

Maven的部署文件需要一個項目來執行,但沒有找到POM文件

[英]maven deploy-file requires a project to execute but no pom file is found

我正在嘗試使用Maven部署文件,但不斷收到此異常:

org.apache.maven.lifecycle.MissingProjectException:您指定的目標需要一個項目來執行,但是此目錄(..)中沒有POM

使用此命令:

mvn -X deploy:deploy-file \
       "-DrepositoryId=Private_Snapshots" \
       "-Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/" \
      "-DgeneratePom=true" \  
      "-DgroupId=Generator" \
       "-DartifactId=PConfigurator" \
       "-Dversion=1.1.0.0-SNAPSHOT" \
       "-Dfile=./PConfigurator.apk"

我的settings.xml文件包含:

<servers>
    <server>
      <id>Private_Snapshots</id>
      <username>USERNAME</username>
      <password>XXXXXXXXXXXX</password>
    </server>
 </servers>

如果需要pom.xml,它將是什么樣? 謝謝

我嘗試添加-Dpackaging = android:apk或-Dpackaging = apk,結果相似。 deploy和:deploy-file之間沒有空間。 這是失敗的其他輸出:

+ /usr/local/apache-maven/bin/mvn -X deploy:deploy-file -DrepositoryId=Private_Snapshots -Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/ -DgeneratePom=true ' '
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_91/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.12.1.el6.x86_64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/apache-maven/conf/settings.xml
[DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
[DEBUG] Using local repository at /home/jenkins/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/jenkins/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.094s
[INFO] Finished at: Tue Aug 30 19:55:58 UTC 2016
[INFO] Final Memory: 6M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (.). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (.). Please verify you invoked Maven from the correct directory.
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    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.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR] 
[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/MissingProjectException

我有同樣的問題。 我在命令中刪除了反斜杠,然后它起作用了。 因此,您的命令將是這樣的:

mvn -X deploy:deploy-file "-DrepositoryId=Private_Snapshots" "-Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/" "-DgeneratePom=true" "-DgroupId=Generator" "-DartifactId=PConfigurator" "-Dversion=1.1.0.0-SNAPSHOT" "-Dfile=./PConfigurator.apk"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM