|
We're using Artifactory OSS to manage our Maven repository. It's great in pretty much all ways except for one: deploying an artifacts bundle. Don't get me wrong, the function itself works great as well. The problem is the format for the artifacts bundle and how that gets created. This process is really clunky, at least the way I'm doing it. I'm wondering if I'm missing something or if there's a better way to do this.
So suppose you want to deploy an artifact with the groupId org.myorg, the artifactId myartifact, and version 1.0. What I'm currently doing is running the following command: mvn clean install source:jar javadoc:jar This generates everything I need. Now comes the problem. I go to my local repository, so ~myname/.m2/repository. If that folder had been empty before I started and my project had no dependencies, I could just zip up the org folder, since the only things under it would be myorg/myartifact/1.0/... But of course that's never how it works. In fact, I have many dependencies that also get downloaded and cached in my local repository and there are even other artifacts under org/myorg and there may even be other versions of org.myorg:myartifact. So to work around this, I create a full folder hierarchy in some working folder somewhere: mkdir /tmp/org/myorg/myartifact cd /tmp cp -R ~myname/.m2/repository/org/myorg/myartifact/1.0 org/myorg/myartifact zip -r bundle.zip org rm -r org Now I can deploy bundle.zip and everything will be properly handled. That seems a little ridiculous. I've messed around with the maven-assembly-plugin and the maven-repository-plugin, but these don't really produce that mirror of the local repository that Artifactory wants. So like I said, am I missing something here? Is there a relatively straightforward way to get Maven to generate a Zip file in the format that Artifactory wants? Perhaps a JFrog custom plugin? If there's not, there REALLY oughta be. Any help on this issue would be greatly appreciated. |
|
Hi,
Well my first question will be why aren't you using maven deploy to deploy the artifacts to artifactory instead of ziping them and unzipping? Artifactory don't care about the layout path you bundle your artifacts, unless you also bundle poms which then there will be a pom consistency check before deployment and in your case you are missing the version in the folder structure(org/myorg/myartifact/1.0/), BTW you can turn off the verification in the target repository configuration panel but it is not recommended. If you are not going to use mvn deploy you'll might want to automate the publish process using the REST API, here is an example using CURL curl -X PUT -i -u deployer:password --data-binary @path_to_artifact.jar http://myhost:port/artifactory/myRepo/org/myorg/myartifact/1.0/myartifact-1.0.jar HTH, Eli
On Thu, Jan 12, 2012 at 10:54 PM, rherrick <[hidden email]> wrote: We're using Artifactory OSS to manage our Maven repository. It's great in ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ Artifactory-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
I've had issues in the past getting mvn deploy to work properly, so that's why I haven't used it here. I had kind of written it off due to my problems with that. Of course, we had an overly secure network structure the last time I tried this, so it's worth trying again.
We also have third-party artifacts that we have to deploy, but those are fairly limited in scope, so it's not a big deal to create the folder structure. |
| Powered by Nabble | See how NAML generates this page |
