I am searching for a Maven plug-in that would help me download project artifacts. For example, I've a remote location, with the following directory structure:
Directory-A
Directory-B
artifact1.jar
artifact2.jar
Directory-C
artifact3.jar
artifact4.jar
All I want to do is when I specify Directory-A/Directory-B, it creates the structure locally and downloads all the artifacts from the remote location to the local structure.
Is that possible in Maven? The closest that I got is via maven-download-plugin, as suggested in this SO answer. However, this plugin lets me download individual artifacts (or as far as I understood from the usage documentation).
Thoughts, ideas? Any help would be really appreciated.
Related
currently I´m working on converting a java project from ant to maven and one step to accomplish this is to find matching artifacts (via SHA1 checksum) in the nexus repository manager, see step 4 here: https://dzone.com/articles/ant-to-maven-conversion-the-painless-method
first I got all the SHA1 signatures of all jar files where I don´t know the specific version (since it´s not my own java project).
then I tried several times to use the following link to search for the artifacts by using the SHA1 checksum as my search query:
https://repository.sonatype.org/
but somehow I get no matching artifacts, no matter what I search.
can anybody help here please?
what am I doing wrong? maybe sonatype repo is not working properly any longer?
or is there any other method to search artifacts via checksum?
Search on https://search.maven.org/, which is the "official" Maven repository.
So my job has 2 parts. The first part downloads all the required maven artifacts from a central online repository. The second part uses the download folder as an online repository(by changing URL from central repo to local folder) to build our product.
But there are certain artifacts which do not have a maven-metadata.xml after the first part of the job. As a result, the second part fails. I don't want to hardcode the online repo and curl as it's not what we're looking for. Neither do I want to copy some other maven-metadata.xml and edit my changes. Also, I cant give the offline option during build, as I do need the artifacts to be picked up from my local repo(downloads).
Any solution to this? Thanks IA.
I have made a decent effort trying to google this but can't seem to find some good guidelines for this.
I suspect *.jar and *.pom are obvious candidates but there might be others.
As one should not just use a maven repo as a file server I guess there are files that should likely never go there (like *.java).
Is there er definitive guide or at least a best practice someone could refer to?
And what about "fat jars" *.ear and *.war.... do they belong in a maven repo? I'm leaning towards no, but maybe my understanding of what a maven repo should provide is just limited.
Technically a Maven repo can have a jar or a war or esb(jboss archive) or any other file type. Think of your local .m2 or a Nexus repository that can have any file type that is an outcome of a build. But for dependency purposes it is almost always the JAR files that are in the repo you would need. HTH
I have created a maven plugin, this is dependent on a series of JARS. i have uploaded these JARs and poms to the relevant location on the server under nexus-data/blobs/maven-thirdparty/{group-id}.
when i run a task to "Rebuild Maven repository metadata" and "Rebuild repository index" these files does not appear when i try and browse the files http://{nexus-server}:port/#browse/browse/assets.
How can i have nexus server recognize the files in the repository?
i will look to that in future. I posted this same question to Sonatype forum and they assisted me with a utility that assists with this and it worked perfectly.
https://github.com/simpligility/maven-repository-tools/tree/master/maven-repository-provisioner
Thanks to Peter Lynch - https://support.sonatype.com/hc/en-us/articles/236210187-How-do-I-export-import-a-Maven-2-format-repository-over-HTTP-
What you are trying to do will not work, although it did in Nexus Repo 2. There currently is no mechanism for adding jars in to the blobstore in this way. We've intentionally added the blobstore and all that goes along with it so that we can do more fun things with searching, metadata, etc... that were much more difficult with a system that just has files on a path. What I might suggest instead is using something like this:
Nexus Exchange - Nexus Repository Import Scripts
GitHub Repo for Scripts
That should help you get the JARs into Nexus Repository 3, into a repo of your choice. I maintain that repo, so if you run into issues, create an issue and I'll see what I can do to help you out! ~Sonatype Community Nerd
I am using alfresco 4.1.3 having following project structure.
I am using the ant script to build project.
Now I want to convert this project into maven based alfresco5.
I have configured alfresco5 using all-in-one archetype and I am able to run it successfully. My questions are:
How can I convert my alfresco ant based project in alfresco5 maven based?
Do I need to add src files in repo or repo-amp?
Do I need to copy all share related files in share or share-amp?
Any help would be greatly appreciated!!!
Thanks in Advance.!!
That totally depends on the ant build setup. But one good guess is that you will have to put the files residing in the "Alfresco" folder of your old project into different subfolders of the repo-amp, and the same way around with the "Share" folder. Most files will go into those folders, you have to study the SDK-docs carefully to know into which folders the files will go. Depending of the nature of your extensions some files could go into the Share and Alfresco war-structure as well (additions to web.xml for example).
There are no "Swiss army knife" for that works for all cases here.
Good luck
Do the following things:
Create new project as maven project and provide group id (it's yours) artifact id as alfresco5 and version (ex:43.0.1-SNAPSHOT)
With this it creates maven based folder structure
src/main/java -> replace it with your src folder
3.src/main/resources ->add your Share, reference and Alfresco folders.
look at you lib directory..what ever .jar will be there you need to define it in dependencies under pom.xml
compile the whole project..if there are compilation errors then add required dependencies in pom.xml