0

I have some problems understanding how the publication works. I have to publish a jar file to my web repository, but I have found some probably maybe by the fact that I missing something about the artifact and the publication.

These are my three files for the publication:

Build.xml

<project xmlns:ivy="antlib:org.apache.ivy.ant" name="pubblication"
 default="pubblication" basedir=".">
    <echo>inizio</echo>

    <target name="pubblication" description="--> pubblicare un artifact">
        <ivy:settings file="archivaIvySetting.xml" />
        <ivy:publish resolver="publish-artifact" conf="publicConf" organisation="bbi"
          module="resutil" revision="1.0">
            <artifacts pattern="./[artifact]-[revision].[type]"/>
        </ivy:publish>
    </target>

</project>

Ivy.xml

<ivy-module version="2.0">
    <info organisation="org.apache" module="central"/>
    <configurations>
        <conf name="publicConf" visibility="public" />
    </configurations>
    <publications>
        <artifact name="[organisation]-resutil" ext="jar" conf="publicConf"/>
    </publications>   
</ivy-module>

archivaIvySetting.xml

<?xml version="1.0" encoding="UTF-8"?>
    <ivysettings>
        <property name="archiva-internal" value="http://host.com:8080/repository
        /internal/"/>
        <settings defaultResolver="central">
            <credentials host="host.com" realm="Repository Archiva Managed internal 
             Repository" username="username" passwd="passwd" />
        </settings>
        <resolvers >
            <ibiblio name="central" m2compatible="true" usepoms="true" root="${archiva-
             internal}" />
        </resolvers>
    </ivysettings>

My problem is that when I do the build that ant says there is no module with that name in the cache. Now the question:

1) In the pattern do I set the jar that I want to publish?

2) If not how do I must to do practically that: take the jar give it the info params and publish it in the repo?

I repeat the file already exist, and this is a test file.

GenericJon
  • 8,746
  • 4
  • 39
  • 50
mautrok
  • 961
  • 1
  • 17
  • 41

1 Answers1

1

The pattern in the publish task should match a that is created locally in your build. Additionally the publish section of the ivy file must match the files your attempting to upload.

Hopefully some examples will help:

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • your answer is great, because with these three links put together you were near to make a tutorial for the publications, but i still have a problem, even if my build publish the artifact on archiva and the file is present in the repo, archiva ui view doesn't see the jar file, it's like my folder is empty any idea why? thanks – mautrok Jul 25 '14 at 08:47
  • @mautrok I see you posted a new question on your archiva issue (http://stackoverflow.com/questions/24957374/archiva-graphic-interface-doesnt-find-my-artifact). – Mark O'Connor Jul 25 '14 at 19:09