Force install dependency.

I have a maven project with a dependency in the pom:
<dependency>
<groupId>tld.domain1</groupId>
<artifactId>name</artifactId>
<version>0.0.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>tld.domain1</groupId>
<artifactId>name</artifactId>
<version>0.0.0.0</version>
<scope>provided</scope>
</dependency>
This dependency does not exist at any of the repositories in the pom; I don't want to change the pom. Instead, I want to fetch the dependency jar from somewhere (wget), store it locally, and build the project with that. This is with mvn in docker.
3 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Pheotis! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Pheotis
PheotisOP6mo ago
I am currently wgetting the dependency jar, putting it in the folder with the project's files, and running:
mvn -X install:install-file -name.jar \
-DgroupId=tld.domain \
-DartifactId=name\
-Dversion="$core_version" \
-Dpackaging=jar \
-DgeneratePom=true
mvn -X install
mvn -X install:install-file -name.jar \
-DgroupId=tld.domain \
-DartifactId=name\
-Dversion="$core_version" \
-Dpackaging=jar \
-DgeneratePom=true
mvn -X install
The first install ... builds?... the dependency successfully, but doesn't build the main project jar. The second install fails to build the main project jar because it is for some reason missing the dependency that was just installed. Figured it out.
JavaBot
JavaBot6mo ago
Post Closed
This post has been closed by <@928755449665298432>.
Want results from more Discord servers?
Add your server