简体   繁体   中英

Publishing a jar file that already exists

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.

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM