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 answers
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
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- JavaFX build generating a blank gui with primary view and secondary view buttons
- Maven (Java) does not build dependencies into a compiled file
- java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator in Spring-boot jsp application
- I am trying to use h2 in-memory db from my spring boot application, my spring boot version is 3.1.10, but its not connecting to h2 properly
- BeanCreationException when deploying Spring Boot app
- How to run Parallel tests by groups using Maven and TestNG?
- Get control flow information with JaCoCo
- Failed to instantiate [com.docusign.esign.client.ApiClient]
- Gradle - Groovy vs Gradle - Kotlin vs Maven for Java Spring Boot web application project on IntelliJ
- Intelij ultimate and spring boot giving me errors
- Using Eclipse Maven project, import new version of a class from a jar file created from another Maven project
- Messing up with conflict between spring jcl and commons-logging.jar
- Run java program
- How to add a Maven project to an Ubuntu image in Docker
Related Questions in MAVEN-3
- Eclipse-Maven Forcefully Overwrites Java Version Set Every Update Project
- How to set the JDK compile and target class version in maven pom file?
- How to include only certain test packages in a maven test-jar & all non test code in a non test jar?
- why running jacoco 0.8.8 with junit 5 does not generate the jacoco files
- Maven : how to add dependency of a jar inside a *.tgz file
- Maven: error when adding a dependency to a jar which is inside a .tgz file
- Is There A Way To Simply Use All Nexus Repositories?
- Seeing error bash: mvn: command not found and getting this error Failed to collect dependencies at io.github.bonigarcia:webdrivermanager:jar:5.6.3:
- Unable to fetch maven dependencies from company's nexus repository
- Looking for active and supported maven plugin to compile less to css?
- java: error: invalid source release: 15 SpringBoot application
- How to override the Built-By property in the manifest?
- Unable to run git-commit-id-plugin once and use in child projects
- How to create multiple independent Maven Multi Modules in a monorepo?
- Maven doesn't resolve transitive dependency correctly
Related Questions in MAVEN-PLUGIN
- Maven plugin 100% compatible Java21 to generate stub classes from WSDL file and generate *.wsdl from java classes? A solution
- Unable to find a single main class with './mvnw clean verify'
- I'm having trouble deploying to heroku. The problem is related to org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
- How to clear Maven project cache?
- Artifact not getting deployed in JFrog Articatory
- Corect Maven project execution plugin configuration when using multimodule application
- Skip change detection on change in parent pom.xml property When using gitflow-incremental-builder
- maven-dependency-plugin could not be resolved
- How to solve the Maven plugin issue in Intellij
- In the pom.xml file of my Spring Boot Maven project, I am encountering the following error. Does anyone have any ideas?
- User Cannot resolve symbol 'buildNumberSeq' Maven
- Dynamic injection using property files in maven and spring boot project
- Junit do not find system scope dependency
- UnsatisfiedLinkError using `jargon2-native-ri-backend` library on Mac air M2
- Error trying to build a jar with springboot and maven
Related Questions in MAVEN-DEPENDENCY-PLUGIN
- maven-dependency-plugin could not be resolved
- How to prevent maven-dependency-plugin from downloading log4j?
- how to fix the netty-handler violation from aqua scanner report under application insights
- Find source of outdated dependencies indicated by Versions Maven Plugin
- maven-dependency-plugin 3.6.+ started to find new 'Used undeclared dependencies found' during dependency:analyze goal
- How to refresh Maven artifacts that has been redeployed?
- How do I execute only the process-sources phase without building the whole maven project?
- Need maven dependency plugin to build dependency locally
- After compiling the proto file, I get "com.google cannot be resolved to a type" error in the created java classes
- How do I detect which dependencies and which libraries in the project are used or which are not?
- Maven internal dependency issues (non-syntactical error)
- Unable to process file error with maven-dependency-analyzer
- The type java.io.File cannot be resolved. It is indirectly referenced from required type org.assertj.core.api.Assertions
- Having issues with MVN Version command showing versions already updated
- Which plugin can copy classes from specific dependency into final jar
Related Questions in MAVEN-DEPLOY-PLUGIN
- Maven upload of zip and pom to Artifactory fails
- Jenkins withMaven and maven-deploy-plugin behaviour changed
- Maven deploy Github Packages: How can I make it override the previous assets?
- Maven is not adding my dependencies to my jar
- Azure Artifacts - deploy status 409 conflict - upstream already contains jar (maven)
- Cannot deploy to GitHub Packages with Maven
- How to set global maven distrubution management settings?
- What is the AccessToken not found error when deploying via Maven to Wso2 Micro Integrator?
- What is maven variable to get full repository URL where artefact/jar is uploaded
- Using Maven to deploy release build to Artifactory results in 403 Forbidden but works for snapshots
- Deploying of Java project not happening in Jenkins using Maven
- Deploying artifacts built by maven to repository
- Maven deploy plugin not picking the value from parent pom properties
- Skip deploy if artifact (with same version) is already present in remote repo
- Who should have the authority to upload Maven artifacts to the remote repository?
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?
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)
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