[英]Multimodule Spring project with Maven
I am trying to build an app with multimodule architecture, where I have the following modules:我正在尝试构建一个具有多模块架构的应用程序,其中有以下模块:
How do I organize the project in order to have shared app-properties in the parent-module?如何组织项目以便在父模块中共享应用程序属性? And should the persistency module have spring-build plugin?
持久性模块应该有spring-build插件吗? Cause at the moment no module sees the properties of the parent.
因为目前没有模块看到父级的属性。
Technically it is possible to force pom
-module to package artifacts , in your case that would be something like:从技术上讲,可以将
pom
-module 强制为 package artifacts ,在您的情况下,类似于:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>configs</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
However in that case child modules inherit build configuration from parent, so you will need to disable configuration of maven-jar-plugin
in child modules.但是在这种情况下,子模块从父模块继承构建配置,因此您需要在子模块中禁用
maven-jar-plugin
的配置。 It is better to create sibling module rather than solving maven puzzles.最好创建兄弟模块而不是解决 maven 难题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.