2014-09-04 152 views
8

當我嘗試將「artifactoryPublish」發送到遠程工具庫時,出現了一個奇怪的問題。Gradle Artifactory插件沒有生成Pom文件

我有任務運行

./gradlew clean jar artifactoryPublish 

只有前幾天哪家合作。現在我得到這個錯誤:

:artifactoryPublish FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem was found with the configuration of task ':artifactoryPublish'. 
> File '/Users/me/Programming/android/LibraryPlugin/build/poms/pom-default.xml'  specified for property 'mavenDescriptor' does not exist. 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more  log output. 

我在做什麼錯?

+1

不妨使用--stacktrace選項來獲取更多信息。 – AHungerArtist 2014-09-04 14:27:35

回答

2

問題中的Gradle構建片段可能很有用,但如果我不得不盲目猜測,我敢打賭,您沒有應用mavenmaven-publish插件(或者您應用了錯誤的插件)。

+0

我有類似於在gradle-android-aar示例中使用'''android-maven'''的問題。我向插件回購> https://github.com/dcendents/android-maven-plugin/issues/17提交了一個問題。 – jdONeill 2015-03-29 00:57:31

+0

@JBaruch,我也遇到類似的錯誤,但我確實有maven和maven-publish插件的應用。 – Jason 2015-08-26 22:39:15

+0

@Jason值得一個單獨的問題與你的構建腳本。 – JBaruch 2015-08-26 23:26:26

19

我正面臨類似的問題,我已經優化了gradle.properties以進行快速編譯。

org.gradle.daemon=true 
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 
org.gradle.parallel=true 
org.gradle.configureondemand=true 

一次刪除它們和編譯代碼工作,你也可以添加對方一旦生成聚甲醛。

很可能「平行=真」是罪魁禍首。

希望它有幫助!

+9

神聖莫里這有幫助!對我來說,我需要禁用'configureondemand'。 – 2016-04-25 20:39:13

+1

對我來說,configureondemand是罪魁禍首。 – GoGoris 2016-05-03 12:45:39

+1

配置給我也是! – peuhse 2017-03-23 16:00:53

2

升級我們的Gradle版本後,我們遇到了同樣的問題,但發現這是使用com.github.dcendents.android-maven插件的舊設置的問題。爲了解決這個問題,我們刪除了configure塊,而是創建了一個任務來創建pom-defaults.xml文件。這是我們的gradle這個文件的相關部分:

task writeNewPom { 
    pom { 
     project { 
      packaging 'aar' 
      name 'Some Name' 
      url 'http://www.example.com' 
      licenses { 
       license { 
        name 'The Apache Software License, Version 2.0' 
        url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 
        distribution 'repo' 
       } 
      } 
     } 
    }.writeTo("$buildDir/poms/pom-default.xml") 
} 

artifactoryPublish { 
    dependsOn assembleRelease 
    dependsOn sourcesJar 
    dependsOn writeNewPom 
} 
+0

爲了這個工作,你需要將整個pom塊包裝在'doLast {}'塊中。 – fast3r 2016-12-12 13:46:09

0

出版,我使用一個自定義插件來解決在我的AS項目中。我將自定義插件中的gradle版本更改爲我在AS中使用的相同版本。然後,我通過終端執行命令,而不是從AS運行。爲我工作

0

有同樣的問題。我通過簡單地運行任務解決它:

./gradlew generatePomFileForWarPublishPublication 

由artifactory插件提供。

相關問題