|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
How to deploy an POM file and JAR to Artifactory Using Ant / Ivy?Hi All
I have a JavaFX project, which creates a JAR artefact. I am using Apache Ivy to generate the POM file. How do I deploy both the JAR file and the POM file simultaneously to an Artifactory using a username and password credentials? I tried using the Apache Ivy task <ivy:install>. Then I tried CURL, calling it through a Ant build script curl -v -X PUT - -data-binary @mylib-1.0.jar -u admin:XYZ1234 http://localhost:8080/artifactory/libs-releases-local/org/jfrog/test/1.0/mylib-1.0.jar However I can seem to deploy the POM to the Artifactory. I remember someone saying that there was REST API, is this the way to go? Maybe I can get to the endpoint with Ant calling a simply Groovy Script or something. Any ideas. re-1.0-SNAPSHOT.pom [exec] * About to connect() to devretappsvr1 port 8080 (#0) [exec] * Trying 10.184.34.102... connected [exec] * Connected to devretappsvr1 (10.184.34.102) port 8080 (#0) [exec] * Server auth using Basic with user 'admin' [exec] > PUT /artifactory/echannel-releases-local/com/xenonsoft/nelson/1.0-SNAPSHOT/nelson- core-1.0-SNAPSHOT.pom HTTP/1.1 [exec] > Authorization: Basic YWRtaW46cmV0YWRtaW4= [exec] > User-Agent: curl/7.19.2 (i386-pc-win32) libcurl/7.19.2 OpenSSL/0.9.8i zlib/1.2.3 [exec] > Host: devretappsvr1:8080 [exec] > Accept: */* [exec] > Content-Length: 140 [exec] > Content-Type: application/x-www-form-urlencoded [exec] > [exec] } [data not shown] [exec] % Total % Received % Xferd Average Speed Time Time Time Current [exec] Dload Upload Total Spent Left Speed [exec] [exec] 140 140 0 0 0 140 0 140 --:--:-- --:--:-- --:--:-- 140< HTTP /1.1 500 Failed to save resource 'echannel-releases-local:com/xenonsoft/nelson/1.0-SNAPSHOT/nels on-1.0-SNAPSHOT.pom'.< Server: Apache-Coyote/1.1 [exec] < Server: Artifactory/2.0.6 [exec] < Content-Type: text/html;charset=utf-8 [exec] <html><head><title>Apache Tomcat/6.0.16 - Error report</title><style><!--H1 {font-fa mily:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-fami ly:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family :Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family :Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-s erif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:wh ite;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-- ></style> </head><body><h1>HTTP Status 500 - Failed to save resource 'echannel-releases-local:co m/xenonsoft/nelson/1.0-SNAPSHOT/nelson-1.0-SNAPSHOT.pom'.</h1><HR size="1" noshade="noshade"><p> type Status report</p><p>message <u>Failed to save resource 'echannel-releases-loc al:com/xenonsoft/nelson/1.0-SNAPSHOT/nelson-1.0-SNAPSHOT.pom'.</u></p><p>description <u>T he server encountered an internal error (Failed to save resource 'echannel-releases-local:com/xe nonsoft/nelson/1.0-SNAPSHOT/nelson-1.0-SNAPSHOT.pom'.) that prevented it from fulfilling this re quest.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.16</h3></body></html> [exec] < Content-Length: 1324 [exec] < Date: Tue, 08 Sep 2009 12:39:49 GMT [exec] < Connection: close Thanks! |
|
|
Re: How to deploy an POM file and JAR to Artifactory Using Ant / Ivy?Hi Peter,
Could you attach the server server log error that is reported when deployment fails? Also, what version of Artifactory are you using? Thanks, Yoav
On Tue, Sep 8, 2009 at 5:50 PM, Peter Pilgrim (JC) <Peter.Pilgrim@...> wrote:
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Artifactory-users mailing list Artifactory-users@... https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
|
Re: How to deploy an POM file and JAR to Artifactory Using Ant / Ivy?HI Yoav I think this is a Apache Ivy problem. I created a Groovy example that uploads the POM and JAR into Artifactory with Basic Authentication. I intend to blog the work-around that I use. It is Ant build file with an external Groovy Script. Part of the problem is that Apache Ivy has this concept of ``resolvers'', but does not provide or enable the feature that enables Basic Authorisation credentials. I mention this when I blog it may be next week on jroller.com. Anyway, I am quite busy this week so I will get you that stacktrace next week. btw: I am using Artifactory 2.0.7 on my local workstation.
|
|
|
Re: How to deploy an POM file and JAR to Artifactory Using Ant / Ivy?This is definitely an Apache Ivy problem
ckup\backup1\20090922.120000.tmp\repositories\plugins-releases-local'. 2009-09-22 12:00:00,701 [INFO ] (o.a.r.j.JcrRepoBase :199) - Exporting repositor y 'plugins-snapshots-local' to 'C:\Documents and Settings\8185838\.artifactory\b ackup\backup1\20090922.120000.tmp\repositories\plugins-snapshots-local'. 2009-09-22 12:00:00,701 [INFO ] (o.a.r.j.JcrRepoBase :199) - Exporting repositor y 'ext-releases-local' to 'C:\Documents and Settings\8185838\.artifactory\backup \backup1\20090922.120000.tmp\repositories\ext-releases-local'. 2009-09-22 12:00:00,716 [INFO ] (o.a.r.j.JcrRepoBase :199) - Exporting repositor y 'ext-snapshots-local' to 'C:\Documents and Settings\8185838\.artifactory\backu p\backup1\20090922.120000.tmp\repositories\ext-snapshots-local'. 2009-09-22 12:00:00,748 [INFO ] (o.a.r.j.JcrRepoBase :199) - Exporting repositor y 'sun-repo-2-cache' to 'C:\Documents and Settings\8185838\.artifactory\backup\b ackup1\20090922.120000.tmp\repositories\sun-repo-2-cache'. 2009-09-22 12:00:00,795 [INFO ] (o.a.s.ArtifactoryApplicationContext:199) - Expo rting security... 2009-09-22 12:00:03,826 [INFO ] (o.a.s.ArtifactoryApplicationContext:199) - Full system export completed successfully. 2009-09-22 13:10:09,286 [ERROR] (o.a.w.s.RequestUtils:89) - Request /echannel-re leases-local/com/xenonsoft/nelson/nelson-core/1.0-SNAPSHOT/nelson-core.jar shoul d be a repo request and does not match any repo key Clearly if there resolvers that handled BASIC AUTHENTICATION it will work. I cannot reproduce the internal server error I had two weeks ago. <ivysettings> <!-- Define Apache Ivy Local Repository --> <property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local" /> <!-- Define Apache Ivy Shared Repository --> <property name="ivy.shared.default.root" value="${artifactory.url}" /> <property name="ivy.shared.default.ivy.pattern" value="[organisation]/[module]/[revision]/ivy.xml" /> <property name="ivy.shared.default.artifact.pattern" value="[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]" /> <credentials realm="admin" host="${tester.artifactory.url}" username="${tester.artifactory.username}" passwd="${tester.artifactory.password}" /> <settings defaultResolver="chain-example" /> <resolvers> <!-- Specifies the software developer's local repository on his or her workstation --> <filesystem name="local" local="true" m2compatible="false" > <ivy pattern="${ivy.local.default.root}/[organisation]/[module]/ivys/ivy-[revision].xml"/> <artifact pattern="${ivy.local.default.root}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" /> </filesystem> <!-- Specifies XeNoNiQUE 3rd Party repository repository --> <ibiblio name="xenonique" root="${artifactory.repo.url}" m2compatible="true" checksums="sha1,md5" usepoms="true" useMavenMetadata="true" pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" /> <!-- Specifies internal third party library repository --> <url name="internal" descriptor="optional" checkmodified="true" m2compatible="true" checksums="sha1,md5" > <artifact pattern="${artifactory.deploy.url}/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]" /> <artifact pattern="${artifactory.deploy.url}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" /> </url> <!-- Specifies internal third party library repository --> <url name="shared" descriptor="optional" checkmodified="true" m2compatible="true" checksums="sha1,md5" > <artifact pattern="${tester.artifactory.url}/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]" /> <artifact pattern="${tester.artifactory.url}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" /> </url> <!-- http://repo2.maven.org/maven2/com/google/code/google-collections/google-collect/snapshot-20080530/google-collect-snapshot-20080530.pom --> <ibiblio name="ibiblio-m2-A" root="http://repo2.maven.org/maven2/" m2compatible="true" checksums="sha1,md5" usepoms="true" useMavenMetadata="true" pattern="[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]" /> <ibiblio name="ibiblio-m2-B" root="http://repo2.maven.org/maven2/" m2compatible="true" checksums="sha1,md5" usepoms="true" useMavenMetadata="true" pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" /> <ibiblio name="java.net.m1" root="http://download.java.net/maven/1/" m2compatible="false" usepoms="true" useMavenMetadata="true" pattern="[organization]/[type]s/[module]-[revision].[ext]" /> <ibiblio name="java.net.m2" root="http://download.java.net/maven/2/" m2compatible="true" usepoms="true" useMavenMetadata="true" /> <chain name="chain-example" returnFirst="true" > <resolver ref="local"/> <resolver ref="xenonique"/> <resolver ref="ibiblio-m2-A" /> <resolver ref="ibiblio-m2-B" /> <resolver ref="java.net.m1" /> <resolver ref="java.net.m2" /> </chain> </resolvers> </ivysettings> Here the credentials you supply are suppose to filter through, I think. It is not well documented on the Apache Ivy web site. So tester.artifactory.url=http://privateserver.com/ for example, and you use Ant build target to perform a ``shared'' deployment of the module. <target name="install-shared-olde" depends="prepare" description="Publish the target modules into the SHARED Apache Ivy Repository"> <tstamp> <format property="now" pattern="yyyyMMddHHmmss" locale="en,UK" /> </tstamp> <ivy:publish artifactspattern="${dist.dir}/[artifact]-${project.version}.[ext]" resolver="shared" pubrevision="${project.version}" pubdate="${now}" status="integration" forcedeliver="true" overwrite="true" /> <echo message="Project ${ant.project.name} published to shared repository with version ${project.version}" /> </target> In the combination with the ivy.xml for your project, this would work. As I said before it would easier if the Ivy team actually created the credentials as part of the resolver. Anyway I worked my way around with some Groovy Script. I still have to blog about the workaround. Just case you are all wondering this is all for my nascent JavaFX project, Nelson on Kenai. http://www.jroller.com/peter_pilgrim/entry/xenondatagrid_m3_0_nelson_framework http://kenai.com/projects/nelson http://www.xenonique.co.uk/hudson/job/Nelson_Framework_Core_1.2/
|
|
|
Re: How to deploy an POM file and JAR to Artifactory Using Ant / Ivy?Thanks for the update Peter!
On Tue, Sep 22, 2009 at 3:29 PM, Peter Pilgrim (JC) <Peter.Pilgrim@...> wrote:
------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Artifactory-users mailing list Artifactory-users@... https://lists.sourceforge.net/lists/listinfo/artifactory-users |
| Free embeddable forum powered by Nabble | Forum Help |