Note that there are some explanatory texts on larger screens.

plurals
  1. POIvy and Snapshots (Nexus)
    text
    copied!<p>I'm using ant, ivy and nexus repo manager to build and store my artifacts. I managed to get everything working: dependency resolution and publishing. Until I hit a problem... (of course!).</p> <p>I was publishing to a 'release' repo in nexus, which is locked to 'disable redeploy' (even if you change the setting to 'allow redeploy' (really lame UI there imo). You can imagine how pissed off I was getting when my changes weren't updating through the repo before I realised that this was happening.</p> <p>Anyway, I now have to switch everything to use a 'Snapshot' repo in nexus. Problem is that this messes up my publish. I've tried a variety of things, including extensive googling, and haven't got anywhere whatsoever. The error I get is a bad PUT request, error code 400.</p> <p>Can someone who has got this working please give me a pointer on what I'm missing. </p> <p>Many thanks, </p> <p>Alastair</p> <p>fyi, here's my config:</p> <p>Note that I have removed any attempts at getting snapshots to work as I didn't know what was actually (potentially) useful and what was complete guff. This is therefore the working release-only setup.</p> <p>Also, please note that I've added the XXX-API ivy.xml for info only. I can't even get the xxx-common to publish (and that doesn't even have dependencies).</p> <p>Ant task:</p> <pre><code>&lt;target name="publish" depends="init-publish"&gt; &lt;property name="project.generated.ivy.file" value="${project.artifact.dir}/ivy.xml"/&gt; &lt;property name="project.pom.file" value="${project.artifact.dir}/${project.handle}.pom"/&gt; &lt;echo message="Artifact dir: ${project.artifact.dir}"/&gt; &lt;ivy:deliver deliverpattern="${project.generated.ivy.file}" organisation="${project.organisation}" module="${project.artifact}" status="integration" revision="${project.revision}" pubrevision="${project.revision}" /&gt; &lt;ivy:resolve /&gt; &lt;ivy:makepom ivyfile="${project.generated.ivy.file}" pomfile="${project.pom.file}"/&gt; &lt;ivy:publish resolver="${ivy.omnicache.publisher}" module="${project.artifact}" organisation="${project.organisation}" revision="${project.revision}" pubrevision="${project.revision}" pubdate="now" overwrite="true" publishivy="true" status="integration" artifactspattern="${project.artifact.dir}/[artifact]-[revision](-[classifier]).[ext]" /&gt; &lt;/target&gt; </code></pre> <p>Couple of ivy files to give an idea of internal dependencies:</p> <p>XXX-Common project:</p> <pre><code>&lt;ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"&gt; &lt;info organisation="com.myorg.xxx" module="xxx_common" status="integration" revision="1.0"&gt; &lt;/info&gt; &lt;publications&gt; &lt;artifact name="xxx_common" type="jar" ext="jar"/&gt; &lt;artifact name="xxx_common" type="pom" ext="pom"/&gt; &lt;/publications&gt; &lt;dependencies&gt; &lt;/dependencies&gt; &lt;/ivy-module&gt; </code></pre> <p>XXX-API project:</p> <pre><code>&lt;ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"&gt; &lt;info organisation="com.myorg.xxx" module="xxx_api" status="integration" revision="1.0"&gt; &lt;/info&gt; &lt;publications&gt; &lt;artifact name="xxx_api" type="jar" ext="jar"/&gt; &lt;artifact name="xxx_api" type="pom" ext="pom"/&gt; &lt;/publications&gt; &lt;dependencies&gt; &lt;dependency org="com.myorg.xxx" name="xxx_common" rev="1.0" transitive="true" /&gt; &lt;/dependencies&gt; &lt;/ivy-module&gt; </code></pre> <p>IVY Settings.xml:</p> <pre><code>&lt;ivysettings&gt; &lt;properties file="${ivy.project.dir}/project.properties" /&gt; &lt;settings defaultResolver="chain" defaultConflictManager="all" /&gt; &lt;credentials host="${ivy.credentials.host}" realm="Sonatype Nexus Repository Manager" username="${ivy.credentials.username}" passwd="${ivy.credentials.passwd}" /&gt; &lt;caches&gt; &lt;cache name="ivy.cache" basedir="${ivy.cache.dir}" /&gt; &lt;/caches&gt; &lt;resolvers&gt; &lt;ibiblio name="xxx_publisher" m2compatible="true" root="${ivy.xxx.publish.url}" /&gt; &lt;chain name="chain"&gt; &lt;url name="xxx"&gt; &lt;ivy pattern="${ivy.xxx.repo.url}/com/myorg/xxx/[module]/[revision]/ivy-[revision].xml" /&gt; &lt;artifact pattern="${ivy.xxx.repo.url}/com/myorg/xxx/[module]/[revision]/[artifact]-[revision].[ext]" /&gt; &lt;/url&gt; &lt;ibiblio name="xxx" m2compatible="true" root="${ivy.xxx.repo.url}"/&gt; &lt;ibiblio name="public" m2compatible="true" root="${ivy.master.repo.url}" /&gt; &lt;url name="com.springsource.repository.bundles.release"&gt; &lt;ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /&gt; &lt;artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /&gt; &lt;/url&gt; &lt;url name="com.springsource.repository.bundles.external"&gt; &lt;ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /&gt; &lt;artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /&gt; &lt;/url&gt; &lt;/chain&gt; &lt;/resolvers&gt; &lt;/ivysettings&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload