Our project is using Nexus Repository Manager to store all the jars. Along with the jar I see that under a group there are other files like pom.xml, .md5, .sha1 file. I am in need of these files at our server startup. Is there a way that I can download all the files under a particular group programatically using Java/Curl command/mvn dependency command at runtime?
Download all files under a groupId from Maven Repository through command or Java program
2.2k Views Asked by Swapnil Jaju At
2
There are 2 best solutions below
0
Swapnil Jaju
On
I could do it with the simple approach. Club all the xmls into a JAR/ZIP file and upload that zip file under my groupId to the Maven Repository. Then programatically use CURL/WGET to download the zip and unzip the contents of that zip file (using any available utility) at runtime.
- Put all XMLs under a zip file.
- Use mvn deploy to load this zip file to my Maven Nexus Repo.
- Then Programatically during runtime, download the zip file using simple weburl call to that ZIP file.
- Use ZIP4J or any other library to unzip the contents to my required output folder
- Pick files from this server when needed during the flow.
Hope its helpful to someone somewhere sometime. :)
Related Questions in MAVEN
- Auto reload with play2
- maven pom.xml dependencies order vs classpath/build path order
- How to ignore or fix the duplicate classes warning?
- Scala Eclipse IDE compiler giving errors until "clean" is run
- How to run multiple "mvn test"-commands from batch file?
- Not able to send email in java using SMTP,its blocked by firewall in my office.Is there any other method by which we can send mail?
- javaCV Maven project
- Logging error when executing Maven SonarQube plugin
- Gradle: Override transitive dependency by version classifier
- Why we need maven if there's javac that compiles the code?
- jar file input == null while java app is working
- JPA and web app
- Test Selector Plugin Jenkins returns No tests were executed
- Eclipse OSGI unsatisfied constraint
- GlassFish 4.0 CDI deployment failure + Apache Spark
Related Questions in MAVEN-3
- JENKINS Maven Build Failure
- ClassNotFoundException: com.ibm.mq.jms.MQConnectionFactory (Websphere MQ 7.5 + spring jms + maven tomcat 7 plugin)
- Maven: how to build jar and include as a dependency
- Profile property not resolving in POM - Maven 3.2.1
- How to change hibernate.cfg.xml file path through maven when building project?
- mvn archetype:generate issue
- Batch file - What is the root folder when using -f
- Maven 3.0.5 refuses our updated nexus certificate
- Maven in OSX Keeps Compiling with Java 1.5
- Maven implicit profile Activation
- PluginResolutionException when I run mvn test on the project
- Maven not working when 'mvn package' command is run
- how to define path to superpom?
- Unable to load the mojo 'set-version' in the plugin due to an API incompatibility
- Maven -D options not working in Windows 7
Related Questions in MAVEN-PLUGIN
- Auto reload with play2
- Maven installation error in Eclipse Indigo
- Profile property not resolving in POM - Maven 3.2.1
- mvn archetype:generate issue
- Is it mandatory to specify maven-failsafe-plugin to run integration tests?
- Maven java.exec environment variable is picked up by maven, but not picked up by the class
- The method is undefined for the type [Class Name]
- What is priority of parameters passed to maven plugin?
- Copy runnable jar after install
- Compilation Error on maven
- Running main method from test class via maven
- What is the syntax to run a maven plugin from the command line.
- aspectj within a maven plugin fails to call pointcut
- Maven compile-phase bound plugin running to late.
- Able to generate documentation using mvn site command without using mvn-site-plugin
Related Questions in MAVEN-DEPENDENCY-PLUGIN
- Don't copy parent pom when copying child modules
- "Failed to read artifact descriptor" when compiling maven-dependency-plugin:
- Maven dependency:copy artifact with base version
- Maven Reassembling Matching Test and Source Jars while maintaining DRY principal
- How to read the maven dependecy of chrome browser which is a .jar file into my java file
- How To Add Maven Dependency (Android Studio)
- Maven Dependency Plugin Not Using Parameters
- How to search transitive pom dependencies (for snapshots in particular) and prevent releases with any snapshot dependencies?
- How to install google protobuf on FreeBSD
- Output from maven dependency:tree, which version will override
- maven dependency plugin - exclude transitive dependencies
- Optional dependencies in copy-dependencies
- Download all files under a groupId from Maven Repository through command or Java program
- maven-dependency-plugin:unpack fails in Eclipse
- How to tell maven-dependency-plugin that the artifact is used in the project?
Related Questions in MAVEN-DEPLOY-PLUGIN
- Gradle does not pick correct version of war file in Jenkins
- Why does mvn release:perform always create a new snapshot version and upload that to the repository instead of the non-snapshot release version?
- Maven deploy to multiple remote hosts using ssh(scp)
- How to stop maven-deploy-plugin:deploy-file deploying source?
- Can't override POM property on the command line while executing release:perform
- Can I change the timestamp of a snapshot to the build number?
- Download all files under a groupId from Maven Repository through command or Java program
- Change the artifact name while uploading to Maven Repository through command line
- maven-metadata.xml is not updated when deploying to nexus
- Maven Deploy Plugin
- Why is Maven uploading incorrectly snapshots to release repository?
- How to modify settings of POM file to support access tokens on Artifactory using Maven
- Who should have the authority to upload Maven artifacts to the remote repository?
- Skip deploy if artifact (with same version) is already present in remote repo
- Bind javadoc and sources goals to deploy phase before deploy goal is run
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Maven also uses local repository for caching. The default location is
Default: ${user.home}/.m2/repository. You can check this setting in file settings.xml under [maven_dir]/conf/.To update dependencies, use
-Uoption. i.e.mvn clean install -UDo not forget setting nexus repo inside pom.xml file http://maven.apache.org/pom.html#Repository