简体   繁体   中英

One maven project using different dependencies in build phase

I've got a project, name it project1 and this project contains one pom.xml . Now, what I want to achieve is, that I want to specify two different "Profiles" in Eclipse when I run a maven build on the project and then each of the two profiles should use it's own dependencies. For example in build phase "build_project1_dependency1" it should use the following dependency:

<dependency>
            <groupId>com.example</groupId>
            <artifactId>ProjectX</artifactId>
            <version>1.0.11</version>
</dependency>

and in the second build phase profile called "build_project1_dependency2" it should use the following dependency instead of the first one:

<dependency>
            <groupId>com.example</groupId>
            <artifactId>ProjectX</artifactId>
            <version>1.0.12</version>
</dependency>

I canno't commet because i'm new here so i'll copy the link. (i have no idea if it is right or not)

Maven assembly : add different version of the same artifact

or you can try this:

Copy two versions of same jar using maven

just search :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM