I have several maven-projects:
While commons-lib is unlikely to ever be released separately, all other projects (except for the parent) might be released separately.
If the first four in the list are sub-modules of the fifth, do they have to have their parent set to parent (e.g. all-services-parent) in return?
Since I want to include commons-lib in the user- and composite-services I understand that I have to have it built first. However: each of the services above may be released separately - so which building structure is most proper for what I need?
Would it be:
-- all-services-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) user-service
|-- (maven sub-module) composite-service
|-- (maven sub-module) frontend-service
or:
-- all-services-parent
|-- user-service-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) user-service
|-- composite-service-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) composite-service
|-- frontend-service
The second building structure would allow me to build all the JARs by calling "mvn clean install" on all-services-parent while still being able to build separate projects properly by calling "mvn clean install" on the corresponding parent, but is it really how it's done?
In my current setup I am trying to use the first building structure, but since e.g. composite-service has "spring-boot-starter-parent" set as its parent, I cannot access the properties or anything from the "all-services-parent"-module.
I read into Maven parent pom vs modules pom (a question that looked promising at first), but it did not apply to my case as much as I would like it to.
With Maven 3.2. 1, you can now use -pl ! <module_name>,! <module_name> to exclude certain modules from the reactor build.
project. basedir : The directory that the current project resides in. This means this points to where your Maven projects resides on your system. It corresponds to the location of the pom. xml file.
Maven properties are value placeholders, like properties in Ant. Their values are accessible anywhere within a POM by using the notation ${X}, where X is the property. Or they can be used by plugins as default values, for example: In your case you have defined properties as version of java. Now this property( java.
Try to import the spring boot parent and not inherit from it like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With