如何使用maven-external-dependency-plugin导入非maven JAR并使其成为编译时依赖?

时间:2013-06-04 11:27:54

标签: maven-3


    有没有人使用Maven External Dependency plugin导入非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 =插件在编译步骤之前运行,并且编译步骤将其作为依赖项运行。

谢谢, 稻谷

0 个答案:

没有答案