Artifactory maven-metadata.xml and bundles with Java API - maven

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:
Is there a way to request the maven-metadata.xml be recalculated as in the REST call shown here?
Is there any way to indicate that Artifactory needs to auto-generate a simple pom.xml on upload with the Java API?
Is there any way to indicate that the upload is a bundle?
Thanks in advance!

maven-metadata.xml is generated automatically upon deployment. Note that it might take some time – indexing and metadata generation is an async task.
pom.xml generation is not triggered from REST API or Java API ATM. Didn't you mention that you upload the pom.xml?
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.

Related

How to download all available artifacts from a specific repository url in build.gradle

I'm working on a multi-module build which is needed to create an artifact from all WSDLs available on an internal repository. But they are a lot and I don't want to make a list of it, because it might be possible that later another WSDL project is created and needs to be included in the list, if that doesn't happen then the final artifact will be incomplete.
So I need to know if there's any way I can tell gradle to fetch artifacts present on a certain path like domain.com/path/to/repo/wsdls/ and fetch all available artifacts from this path.
I was thinking of creating a configuration which then has this specific repository to download from but it seems configuration does not include a repository and will use defined in build.gradle.
Any way to define a download-everything-pattern in dependencies block?
EDIT: Note: WSDL project means soap services in a zip archive

Publish HTML Javadoc with Gradle

We are publishing Javadoc as a jar through a Maven publish task, but I would like to know now if there is an easy way to upload the HTML directory of the Javadoc (and maybe other pages like Swagger documentation) to a raw Nexus repository?
I've seen I can call curl and scp through Groovy, but I'd rather use a Gradle task if it's possible. I've tried with an Upload task but did not succeed to add a whole directory as artefact in a configuration. I have also looked at dashboards but it is not included.

where to place the external java jar when deploy birt report?

I use some java code to retrieve data from database, and export the java code as runnable jar, placed the jar in eclipse\plugins\org.eclipse.birt.report.viewer_3.7.1.v20110905\birt\scriptlib, then in the birt report I can use the jar to get the data. In eclipse all goes smoothly, I can see the correct data in preview.
but when I upload the myreport.rptdesign to the server, I don't know where to place the jar then the report can refer to it. In our team, they use grails to deploy birt report, all I need to do is upload the rptdesign file to a specified server directory, when there's no java jar to refer, that's enough. but when I need to refer to a java jar, I do not know how to deploy.
Please help and thanks a lot.
=========================================================
here is answer of my question. Just put the jar in directory lib of grails. It works!
Did you try to put the jar file in the server/lib directory? What kind of application server are you currently using?

Library to create and upload jar dynamically to maven repository

I have service based environment in which I have to create a jar and upload it dynamically to maven repository and return the dependency tree for it. Is there any library which will create a jar file and upload that jar file to maven repository and will return me dependecny of uploaded jar. Right now Im creating it with maven goals in eclipse but I don't want that.
Thanks,
If you don't want to use the command line or IDE, have you looked at the Maven API? There's also an 'undocumented' Maven embedder project.
Below are some links that may help you get started, pick the approach that is easier for you, while meeting your requirements:
https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/main/java/hudson/maven/MavenEmbedder.java
http://maven.apache.org/ref/3.0.2/maven-embedder/apidocs/org/apache/maven/cli/MavenCli.html
http://q4e.googlecode.com/svn-history/r819/trunk/plugins/maven/core/src/org/devzuz/q/maven/embedder/internal/EclipseMaven.java
http://developers-blog.org/blog/def../2009/09/18/How-to-resolve-an-artifact-with-maven-embedder

adding artefacts in Archiva not through its interface

How can I insert artefact in archiva not through its web interface.
It is possible to upload artifacts using maven.
Please refer to the Archiva Users Guide, Section Deploying to Repository for the details.
The following methods are available:
upload via the user interface (I presume this is the one you refer to as the web interface)
connect via any WebDAV client at http://localhost:8080/archiva/repository/repo-name (adjust according to your configuration)
use HTTP PUT with basic authentication to the same location as the WebDAV URL (this is the method that other tools like Maven, Ivy, etc. would use)
drop the file into the correct place in the file system and wait for Archiva's scanner to pick up the changed artefact
As Torsten's answer indicates, uploading using Maven's deploy phase or deploy:deploy-file goals (or equivalent from another build tool) is likely what you want since it will take care of constructing the correct path for the artefact and pushing any associated metadata, assuming you are using Archiva as a Maven artefact repository.
You have an upload screen tru the web ui.
See http://www.youtube.com/watch?v=LSXe26inf0Y

Resources