1

I'm attempting to upload & deploy a jar that we receive from a vendor into Artifactory using the Java API (artifactory-java-client-services v1.1.0). My uploads don't generate maven-metadata.xml and I can't find an option to auto-generate a pom.xml. I also can't find how I would indicate that I'm uploading a bundle rather than a single file.

Currently I'm using a simple snippet of code to upload a test jar and a simple pom:

Path jarPath = Paths.get(tmpDir.toString(), "test1.jar");

RepositoryHandle repositoryHandle = 
    ArtifactoryClient.create(url, username, password).repository(repositoryName);

UploadableArtifact jarArtifact = 
    repositoryHandle.upload("com/company/play/1.0.0/test.jar", jarPath.toFile());

File responseFile = jarArtifact.upload();

I use the same process to upload the pom.xml.

So:

  1. Is there a way to request the maven-metadata.xml be recalculated as in the REST call shown here?

  2. Is there any way to indicate that Artifactory needs to auto-generate a simple pom.xml on upload with the Java API?

  3. Is there any way to indicate that the upload is a bundle?

Thanks in advance!

Community
  • 1
  • 1
Jon Daker
  • 15
  • 4

1 Answers1

3
  1. maven-metadata.xml is generated automatically upon deployment. Note that it might take some time – indexing and metadata generation is an async task.
  2. pom.xml generation is not triggered from REST API or Java API ATM. Didn't you mention that you upload the pom.xml?
  3. Not sure what you mean by "bundle". OSGi bundle? Or an archive that you expect Artifactory to unzip and deploy? In case of OSGi bundle there is nothing needed to be done, in case of the archive, again, it's not supported ATM.
JBaruch
  • 22,610
  • 5
  • 62
  • 90
  • Thanks for the quick response. 1. Ok, I didn't see it when I deployed and didn't see immediate results to the REST call I made so I was concerned. 2. I had read somewhere that Artifactory could auto-generate a pom.xml if it didn't find one in the uploaded .jar file. Perhaps this was wrong. I only uploaded my own out of necessity. 3. Ok, the second was what I was talking about. I'll keep an eye out to see if it changes in the future. Thanks again! – Jon Daker Dec 08 '15 at 18:18
  • Sorry, about the previous comment's 'formatting'. That was my first comment and it has no preview button that I can find. – Jon Daker Dec 08 '15 at 18:24
  • 2. It does generate the pom when you upload via the UI. – JBaruch Dec 08 '15 at 22:13