Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking a maven project's repository portability

Is there any way to check all dependencies are downloadable from at least one listed repository?

I was once omitted a required repository from my pom.xml. But maven didn't complain because those dependencies already had been installed in my local repository (~/.m2/repository).

That could be a problem for CI or on another fresh machine.

So I currently using a shell script which removes all dependencies from ~/.m2 and build maven.

Say...

#!/bin/sh
rm -rf ~/.m2/repository/{my/required/dependencies/group}
maven clean compile

I don't think this is a smart way but it works. :)

Do I have to make a plugin by myself for that?

like image 694
Jin Kwon Avatar asked Jan 01 '26 07:01

Jin Kwon


1 Answers

I'm answering for my own question as Chris advised. Thanks.

I (and any of you) can do this with maven-dependency-plugin. dependency:purge-local-repository

like image 176
Jin Kwon Avatar answered Jan 03 '26 22:01

Jin Kwon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!