[英]How to install a compiled by Gradle jar into the local Gradle Repository files-2.1 instead of the Maven repository?
[英]install multiple jar files in local maven repository
我知道,如果您有一个jar文件,并且您想首先在本地maven存储库中使用它,则需要转到您的maven存储库并通过以下命令进行安装:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id>
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
但是以这种方式,我必须一个一个地安装jar文件,如果我有很多jar文件,我必须多次键入此命令怎么办,难道没有另一种解决方案吗?
如果我不明白这个问题,我深表歉意,但是您不能只用声明为依赖项的jar中的所有内容进行pom吗?
这样,通过安装此pom,您将同时安装所有jar。
使用以下插件
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>some file</file>
<type>extension of your file </type>
<classifier>optional</classifier>
</artifact>
...
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.