We had the exact same issue. There's a setting in Artifactory for your local 
repositories. Go under Admin, edit a local repo, and on the bottom is a 
checkbox "Suppress POM Consistency Check". Make sure that is selected.  

We too produce two artifacts (release and snapshot) and found we couldn't 
publish our snapshot without that checked. 

Since we simply publish with "mvn deploy" I created a snapshot pom-snapshot.xml 
template and use that with <ivy:makepom/> to create both a snapshot and release 
pom.xml file. (I have a special <jar.macro/> macro that emulates the <jar/> 
task but builds the poms and embeds it in my jar just like mvn package would 
do. )

--
David Weintraub
qazw...@gmail.com

Sent from my GOLD iPhone while driving in my Ferrari.
Gold is best!: http://bit.ly/18lVUVm

> On Feb 12, 2014, at 4:52 PM, rickbryant <rick.bry...@gxs.com> wrote:
> 
> Ivy Users,
> 
> We recently completed integration of Ivy dependency management with our
> legacy Ant build and all of our dependency retrieves (Maven formatted) from
> our Artifactory repository work without issue. However, we have encountered
> an odd issue with Ivy publish.
> 
> When publishing two separate artifacts in the same build, the first artifact
> and its associated POM are published successfully. Then the second artifact
> is published successfully but its associated POM is not published and the
> build fails:
> [ivy:publish] DEPRECATED: 'ivy.conf.file' is deprecated, use
> 'ivy.settings.file' instead
> [ivy:publish] :: loading settings :: file =
> c:\Projects\CSR_trunk\Build\ivysettings.xml
> [ivy:publish] :: publishing :: com.gxs.csr#
> [ivy:publish]   published ICSServicesClient to
> http://artifactory.gxsonline.net/libs-snapshot-local/com/gxs/csr/ICSServicesClient/01.02.03.06-SNAPSHOT/ICSServicesClient-01.02.03.06-SNAPSHOT.jar
> [ivy:publish]   published ICSServicesClient to
> http://artifactory.gxsonline.net/libs-snapshot-local/com/gxs/csr/ICSServicesClient/01.02.03.06-SNAPSHOT/ICSServicesClient-01.02.03.06-SNAPSHOT.pom
> [ivy:publish]   published ICSServicesUtilities to
> http://artifactory.gxsonline.net/libs-snapshot-local/com/gxs/csr/ICSServicesUtilities/01.02.03.06-SNAPSHOT/ICSServicesUtilities-01.02.03.06-SNAPSHOT.jar
>  
> 
> BUILD FAILED
> c:\Projects\CSR_trunk\Build\build2.xml:87: The following error occurred
> while executing this line:
> c:\Projects\CSR_trunk\Build\build2.xml:107: impossible to publish artifacts
> for com.gxs.csr#;working@TN-BRYANTR2: java.io.IOException: PUT operation to
> URL
> http://artifactory.gxsonline.net/libs-snapshot-local/com/gxs/csr/ICSServicesUtilities/01.02.03.06-SNAPSHOT/ICSServicesUtilities-01.02.03.06-SNAPSHOT.pom
> failed with status code 409: Conflict
> 
> Here's our Ivy publish task in our build.xml:
> <ivy:publish resolver="artifactory-snapshot-uploads" overwrite="true"
> publishivy="false"
> pubrevision="${majorVersion}.${minorVersion}.${releaseNumber}.${buildNumber}-SNAPSHOT">
>   <artifacts
> pattern="${ICSServicesSrc}/Build/tmp/ICSServicesClient.[ext]"/>
>   <artifacts
> pattern="${ICSServicesSrc}/Build/tmp/ICSServicesUtilities.[ext]"/>
> </ivy:publish>
> 
> Here's our publications segment in our ivy.xml (the two POM files are
> created manually and have different content):
>    <publications>
>        <artifact name="ICSServicesClient" ext="jar" type="jar"/>
>        <artifact name="ICSServicesClient" ext="pom" type="pom"/>
>        <artifact name="ICSServicesUtilities" ext="jar" type="jar"/>
>        <artifact name="ICSServicesUtilities" ext="pom" type="pom"/>
>    </publications>
> 
> And here's the detailed error message from Artifactory:
> Could not save resource
> 'libs-snapshot-local:com/gxs/csr/ICSServicesUtilities/01.02.03.06-SNAPSHOT/ICSServicesUtilities-01.02.03.06-20140204.171744-6.pom':
> The target deployment path
> 'com/gxs/csr/ICSServicesUtilities/01.02.03.06-SNAPSHOT/ICSServicesUtilities-01.02.03.06-20140204.171744-6.pom'
> does not match the POM's expected path prefix
> 'com/gxs/csr/ICSServicesClient/01.02.03.06-SNAPSHOT'. Please verify your POM
> content for correctness and make sure the source path is a valid Maven
> repository root path. Looks like it is expecting the path to be
> ICSServiceClient not ICSServicesUtilities
> 
> We originally thought that Artifactory was causing this issue so we set up a
> WebEx with JFrog. They recommended we disable POM validation on the
> repository and then republish the artifacts. This time the two artifacts and
> their associated POM files published successfully. However, when we looked
> in Artifactory at the contents of the second POM file (ICSServicesUtilities)
> it contained the same exact contents as the first POM file
> (ICSServicesClient) which is incorrect. We did verify that the contents of
> the two POM files we created had different contents so it appears that Ivy
> changed the contents of the second POM file during publication.
> 
> Has anyone else encountered this issue before? Is it not possible to publish
> two artifacts with Ivy to a Maven-based Artifactory repository that are
> located in different paths (requiring different POM files)? For comparison
> purposed we have successfully published these exact two artifacts and
> associated POM files to this repository using Maven Ant Tasks but we woul
> really prefer to use Ivy for publications if possible.
> 
> Thanks,
> Rick  
> 
> 
> 
> 
> --
> View this message in context: 
> http://apache-ivy.996301.n3.nabble.com/Artifactory-Publish-Failure-tp9626.html
> Sent from the ivy-user mailing list archive at Nabble.com.

Reply via email to