我正在编写shell脚本,如果尚未安装它,应该安装它。
是否存在类似mvn install:check artifact-name
的内容?
我正在使用:Apache Maven 3.3.9
答案 0 :(得分:1)
You can try with dependenct:get
in offline mode and specify your repository, the command has the following structure:
mvn dependency:get -Dartifact={groupId}:{artifactId}:{version} -o -DrepoUrl=file://your/repo/path
For example:
mvn dependency:get -Dartifact=junit:junit:4.10 -o -DrepoUrl=file://~/.m2/repository
If it finds the dependency, then you will get:
[INFO] BUILD SUCCESS