Maven install:安装文件似乎不起作用



我创建了一个Maven项目,该项目对不在Maven中心的库(.jar文件)有一些依赖关系。我们拥有的内部存储库正在离线,我们没有被授权创建新的存储库,所以我修改了POM,在激活某个配置文件时,在每个文件上使用install:install-file。它似乎在我的机器上工作,但可能没有工作,因为.jar已经在我的存储库中了。

本周我们有了一位新员工,我试图通过触发配置文件来帮助他安装依赖项,尽管调试跟踪将这些目标列为计划中的目标(mvn help:active-profiles显示配置文件正在激活),但它不起作用。目录是在存储库中创建的,但只为.jar和.pom创建了一个.lastupdated文件。

我们得到的错误是找不到给定工件的POM。这是意料之中的事,因为我们在插件的执行中使用了<generatePom>true</generatePom>

关于为什么这可能不起作用,有什么想法吗?

以下是POM的相关部分:

<profiles>
<profile>
<id>self-contained</id>
<activation>
<property>
<name>installBundledJars</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>installCaseControlUpdateAPI</id>
<phase>generate-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/CaseControlUpdateAPI.jar</file>
<groupId>com.west.thomson.contech</groupId>
<artifactId>CaseControlUpdateAPI</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>installMQ</id>
<phase>generate-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/com.ibm.mq-5.304.jar</file>
<groupId>com.ibm</groupId>
<artifactId>mq</artifactId>
<version>5.304</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>installMQJMS</id>
<phase>generate-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/com.ibm.mqjms-5.304.jar</file>
<groupId>com.ibm</groupId>
<artifactId>mqjms</artifactId>
<version>5.304</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>installJADABAS</id>
<phase>generate-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/jadabas.jar</file>
<groupId>com.softwareag</groupId>
<artifactId>jadabas</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>installOJDBC</id>
<phase>generate-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/ojdbc14.jar</file>
<groupId>oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10g</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

我能想到的两个可能的问题,-检查指定路径中是否有libs。-检查.m2 repo的权限和运行mvn-cmd的项目位置。

最新更新