[英]include one maven project into another maven project using the relative path
I have 3 maven applications.我有 3 个 maven 应用程序。
library-module
book-application:一个 web 应用程序,它使用library-module
中的类library-module
too.博客应用程序:一个 web 应用程序,它也使用library-module
中的类。below are the poms of the modules:-以下是模块的poms:-
....
<!--library-application pom -->
<groupId>com.piyush</groupId>
<artifactId>library-module</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
....
....
<!--book-application pom-->
<groupId>com.piyush</groupId>
<artifactId>book-application</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
....
....
<!--blog-application pom-->
<groupId>com.piyush</groupId>
<artifactId>blog-application</artifactId>
<version>1.0</version>
<packaging>war</packaging>
....
Now I want to add library-application
as dependency to book-application
and blog-application
as dependency like below:-现在我想将library-application
作为依赖项添加到book-application
和blog-application
作为依赖项,如下所示:-
....
<dependency>
<groupId>com.piyush</groupId>
<artifactId>library-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
....
now the catch over here is that I want the library-application
jar to be generated before or during the compilation of book-application
or blog-application
.现在这里的问题是我希望在book-application
或blog-application
编译之前或期间生成library-application
jar 。 So that I don't have to add the jar as provided dependency.这样我就不必添加 jar 作为提供的依赖项。
If you want to build all three artifacts in one build, you can construct a multi-module project with three modules.如果您想在一个构建中构建所有三个工件,您可以构建一个包含三个模块的多模块项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.