将使用ant build和antrun插件创建的jar添加到maven构建依赖项中

问题描述 投票:0回答:1
  • 我有多个使用ant进行构建管理的项目。现在,我们创建了一个新项目,该项目使用Maven进行构建管理。
  • 由于使用maven的新项目依赖于使用ant构建的项目。
  • 我能够使用maven antrun插件将单个项目的构建集成到当前的maven构建中。>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>deploy-artifact</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <ant antfile="../project1/build.xml" inheritAll="false">
                                    <target name="dist"/>
                                </ant>
                                <ant antfile="../project2/build.xml" inheritAll="false">
                                    <target name="dist"/>
                                </ant>
                            </target>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>commons-net</groupId>
                        <artifactId>commons-net</artifactId>
                        <version>1.4.1</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant-commons-net</artifactId>
                        <version>1.8.1</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun</groupId>
                        <artifactId>tools</artifactId>
                        <version>1.5.0</version>
                        <scope>system</scope>
                        <systemPath>${java.home}/../lib/tools.jar</systemPath>
                    </dependency>
                </dependencies>
            </plugin>
  • 我现在面临的问题是,当project1和project2的构建完成时,我希望将使用ant dist目标生成的jar用作当前maven构建中的依赖项。
  • 当前项目的Maven构建已中断,因为它在编译时会查找project1和project2 jar,但它们丢失了。我希望在当前的Maven构建中触发project1和project2的构建,并且不要使用外部命令行mvn:install:install-file
  • 添加依赖项

    任何建议/解决方案将受到高度赞赏。

我有多个使用ant进行构建管理的项目。现在,我们创建了一个新项目,该项目使用Maven进行构建管理。由于使用maven的新项目具有依赖性...

maven maven-3 maven-plugin maven-antrun-plugin
1个回答
0
投票

这不可能。

© www.soinside.com 2019 - 2024. All rights reserved.