maven::install multiple third-party artifacts to local repository 一次从文件系统

标签 maven plugins installation

我们在项目中使用了来自第三方公司的非公开 Artifact 。我们没有安装 Maven 代理(也没有工厂这样做,因为我们发现它使事情复杂化而不是解决问题。尤其是在没有互联网连接或 VPN 可用的情况下)。

所以我创建了一组“maven 安装文件”插件执行,如下所示:

        <plugin>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.3.1</version>
            <inherited>false</inherited>
            <executions>
                <execution>
                    <id>install-artifacts.1</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/gwt-0.99.1.pom</pomFile>
                        <file>thirdparty/gwt-0.99.1.jar</file>
                    </configuration>
                </execution>
                <execution>
                    <id>install-artifacts.2</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/morphia-0.99.1.pom</pomFile>
                        <file>thirdparty/morphia-0.99.1.jar</file>
                    </configuration>
                </execution>
                <execution>
                    <id>install-artifacts.3</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/gwt-oauth2-0.2-alpha.pom</pomFile>
                        <file>thirdparty/gwt-oauth2-0.2-alpha.jar</file>
                    </configuration>
                </execution>
            </executions>
        </plugin>

它运行良好,完全满足我们的需求。但是,如果添加了新 Artifact - 必须添加新的大 XML 部分。

有什么办法可以避免这种情况,例如使用“另一个插件”来搜索文件夹并从中安装所有内容?

最佳答案

这种事情的最佳解决方案是安装 repository manager . 您已经写过您不会安装代理,但这是错误的方式。解决此类问题的唯一方法是安装存储库管理器。

关于maven::install multiple third-party artifacts to local repository 一次从文件系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12080566/

相关文章:

java - 编译后的 Eclipse maven 在 Eclipse 中看不到目标/类文件夹

java - DependONGroups 注释 testng

java - Cucumber 无法解析为类型。 @RunWith( cucumber 类)

linux - 是否可以从应用程序调用 Compiz-Fusion 插件(ADD Helper)?

visual-studio - openFrameworks Visual Studio 设置教程?

java - mvn 命令上出现“错误 : JAVA_HOME is not defined correctly.”

c++ - 如何为我的插件实现自定义数字签名?

visual-studio-2008 - 调试时,Visual Studio 总是在最前面

c++ - libzmq 和 cppzmq 之间以及 zmq.h 和 zmq.hpp 之间的区别?

java - 第二次插件调用后收到 Cordova 插件回调