2016-01-05 7 views
5

मैं एक निजी नेक्सस मेवेन रेपो में फ़ाइल प्रकाशित करने के लिए ग्रेडल (2.9) मेवेन-प्रकाशित प्लगइन का उपयोग करता हूं। build.gradle फ़ाइलग्रेडल मैवेन-प्रकाशित प्लगइन में आर्टिफैक्ट पोम को स्थानांतरित नहीं किया जा सका

apply plugin: 'maven-publish' 

publishing { 
    repositories { 
     maven { 
      name "example-maven" 
      url "https://..." 
      credentials { 
       username mavenUser 
       password mavenPassword 
      } 
     } 
    } 
    publications { 
     maven(MavenPublication) { 

      groupId 'com.example.karaf-utils' 
      artifactId 'esa-bootstrapper' 
      version '1.0.0' 

      artifact source: "${projectDir}/kar/example.esa.bootstrapper.kar", extension: 'kar' 

     } 
    } 
} 

कर फ़ाइल ठीक से अपलोड की गई है और गठजोड़ में मैं उम्मीद एक्सएमएल वर्णनकर्ता देख सकते हैं:

<dependency> 
    <groupId>com.example.karaf-utils</groupId> 
    <artifactId>esa-bootstrapper</artifactId> 
    <version>1.0.0</version> 
    <type>kar</type> 
</dependency> 

लेकिन दुर्भाग्य से, publish कार्य के निष्पादन के दौरान, मैं निम्न त्रुटि:

gradle :com.example.karaf.subsys.bootstrap:publish 
:com.example.karaf.subsys.bootstrap:generatePomFileForMavenPublication 
:com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository 
Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar 
Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar.sha1 
Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar.md5 
Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom 
Could not transfer artifact com.example.karaf-utils:esa-bootstrapper:pom:1.0.0 from/to remote (https://nexus.dev.example.io/nexus/content/repositories/example-maven): Could not write to resource 'com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom' 
:com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository'. 
> Failed to publish publication 'maven' to repository 'example-maven' 
    > Failed to deploy artifacts: Could not transfer artifact com.example.karaf-utils:esa-bootstrapper:pom:1.0.0 from/to remote (https://nexus.dev.example.io/nexus/content/repositories/example-maven): Could not write to resource 'com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom' 

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

BUILD FAILED 

मैं इस त्रुटि को कैसे ठीक कर सकता हूं?

+0

यदि 'https: // nexus.dev.example.io/nexus/content/repositories/example-maven' वास्तव में वह निर्देशिका है जिसे आप तैनात करने की उम्मीद करते हैं, तो समस्या शायद आपके सर्वर पर है: आपके उपयोगकर्ता के पास लिखना नहीं हो सकता है पहुंच। – StephaneM

+0

उपयोगकर्ता को लिखने की सुविधा लगता है: kar फ़ाइल स्वयं कार्य द्वारा सही तरीके से अपलोड हो जाती है –

उत्तर

1

समस्या हल हो गई: बिंदु यह है कि मैं नेक्सस में मौजूदा पोम फ़ाइल को ओवरराइट करने का प्रयास कर रहा था। मैंने कर फ़ाइल हटा दी लेकिन मैं धीरे-धीरे काम करने से पहले पोम को हटाना भूल गया।

संबंधित मुद्दे