1

I have a problem with an Ivy publish build. Here's what I have in my module's ivy.xml:

<publications>
     <artifact name="my-artifact" type="pom" ext="pom"/>
     <artifact name="my-artifact" type="jar" ext="jar"/>
     <artifact name="my-artifact" type="javadoc" ext="jar" m:classifier="javadoc"/>
</publications>

And here's my target:

<target name="my.publish.target">
       <ivy:publish resolver="my-resolver" artifactspattern="${my.dir}/[artifact](-[classifier]).[ext]" pubrevision="${ivy.revision}" publishivy="false" overwrite="true"/>
</target>

This works fine when I run it on my local machine with Windows and publishes exactly 3 artifacts: a compiled jar, a pom and a javadoc jar. When I run it on the server (a Linux machine, not sure if matters), I get the same 3 artifacts but the javadoc jar contains the same classes as the compiled jar instead of the actual javadoc.

I don't understand this since I'm very new to Ivy. Can someone help me?

Thank you.

EDIT

I thought I had mentioned them but I guess I've forgotten. These are my resolvers:

Remote resolver (not working)

<ibiblio name="remote-resolver" m2compatible="true" usepoms="true" root="url_of_the_repository" />

Local resolver (working)

<filesystem name="local-repository" m2compatible="true" cache="local">
  <ivy pattern="${myRoot}/${myPattern}" />
  <artifact pattern="${myRoot}/[organisation]/[module]/[revision]/[module]-([classifier]-)[revision].[ext]"/>
 </filesystem>
Aurasphere
  • 3,841
  • 12
  • 44
  • 71
  • 1
    Does seem like an ivy problem. My recommendation is to first validate that the files are being properly created by Ant. Have you compared the files *before* you publish the jars? I notice that your ivy publish task has an overwrite flag set. This might be hiding an issue. – Mark O'Connor Aug 31 '16 at 07:00
  • Yes, that's the first thing I've checked. The jars are properly created. Also, in my machine the task works as it's supposed to do. That's why I'm not really sure of what's happening. The only things that changes between my local publish and the remote publish is the resolver but that shouldn't affect the result AFAIK. The overwrite flag it's here just because it was there in the example I've followed. I'll try remove that and I'll let you know if anything changes. Thank you for the help! – Aurasphere Aug 31 '16 at 07:24
  • 1
    Ahhhh the resolver. So there is a difference between the platforms. Could you include these details? The resolver is effectively the plugin that performs the integration with the target repository. – Mark O'Connor Aug 31 '16 at 21:06
  • I thought the resolver was only needed to find the artifacts. I've added them. Thank you. – Aurasphere Sep 01 '16 at 06:51
  • 1
    So you're publishing to a Maven repository manager, effectively a 3rd party system which manages the actual file storage. Next question is which product? Sonatype Nexus? Artifactory? And how has it been configured? In the meantime here's an Nexus example: http://stackoverflow.com/questions/5111831/how-to-publish-3rdparty-artifacts-with-ivy-and-nexus/5115447#5115447 – Mark O'Connor Sep 01 '16 at 22:47
  • I'm publishing to Sonatype Nexus. I don't know the configuration details since they weren't done bye me and I can't check for the next two weeks. What I can say is that I did some more tests yesterday. I've tried to publish to the repository from my machine with the exact same configuration and it worked as intended. Somebody suggested that the problem as to do with the ivy versions since it turns out that the remote machine has ivy 2.2 and my local machine has ivy 2.4. I'm going to do more researches on this path. Do you know if this may be the cause? – Aurasphere Sep 02 '16 at 09:19
  • Sorry I don't know. I suggest adding a target to your build to install ivy if it's missing. That might help keep your builds in sync. See: http://stackoverflow.com/questions/34834302/ivy-jar-located-in-my-dep-lib/34842616#34842616 – Mark O'Connor Sep 02 '16 at 20:17
  • Don't apologize, you helped me a lot! Thank you! I'll post an answer as soon as I know more! – Aurasphere Sep 02 '16 at 20:51
  • @MarkO'Connor I've eventually discovered that this problem was caused by a groovy script executed by the remote machine, so it wasn't really related to Ivy. If you are willing to publish an answer describing how to troubleshoot this I'll accept it since you helped me a lot. Thank you! – Aurasphere May 22 '17 at 09:24

0 Answers0