有没有人使用Maven 外部依赖插件将非 Maven 外部 JAR 作为编译时依赖项导入?此链接中给出的示例对我没有帮助,因为它没有在编译阶段之前执行?有没有办法在项目的编译阶段之前导入 JAR 并使其成为 Maven 工件和依赖项?任何例子会有帮助吗?甚至可以将其部署并声明为编译时依赖项吗?在我的项目中,编译器插件似乎在它之前运行并且编译失败。我希望这个插件在此之前运行。
<plugins>
<plugin>
<groupId>com.savage7.maven.plugins</groupId>
<artifactId>maven-external-dependency-plugin</artifactId>
<version>0.6-SNAPSHOT</version>
<inherited>false</inherited>
<configuration>
<stagingDirectory>
${project.build.directory}/dependencies/
</stagingDirectory>
<createChecksum>true</createChecksum>
<skipChecksumVerification>false</skipChecksumVerification>
<force>false</force>
<artifactItems>
<artifactItem>
<groupId>com.thoughtworks</groupId>
<artifactId>customer-provider</artifactId>
<version>1.0</version>
<downloadUrl>file://${customerapp.path}</downloadUrl>
<packaging>jar</packaging>
</artifactItem>
</artifactItems>
</configuration>
</plugin>
Maven 输出(为了保密,删除了项目名称和代码位置):
--- maven-clean-plugin:2.4.1:clean (default-clean) @ ... ---
[INFO] Deleting ....
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ... ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory ....
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ ... ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to ...
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
正如你所看到的,我希望这个 maven-external-dependency=plugin 在编译步骤之前运行,并让编译步骤将它作为依赖项。
谢谢,稻田