There is a Maven project that used to have JAR packaging type. Now the project has evolved, and it is required that it be built as EAR, including the JAR proper and its dependencies altogether.
Does it necessarily mean I have to introduce the second POM with EAR packaging type? Is it possible to build JAR+EAR from a single Maven project? The reason behind that is that I don't really want to radically reorganize my repository structure.
If not possible, I guess I'd need to somehow reorganize project structure to make use of Maven modules. What (sub)module structure would you recommend in that case?
You will need 3 poms, here is a working example;
pom 1 is the parent
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.greg</groupId>
<artifactId>ear-example</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>ear-example</name>
<modules>
<module>example-jar</module>
<module>example-ear</module>
</modules>
</project>
pom 2 is the jar or war
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>ear-example</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>example-jar</artifactId>
<packaging>jar</packaging>
<name>com.greg</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
pom 3 is the ear which has a dependency to the jar/war and uses the ear plugin
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greg</groupId>
<artifactId>ear-example</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>example-ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>com.greg</groupId>
<artifactId>example-jar</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
</project>
I think you can use maven war plugin to generate a single war file every time you build the project
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.2</version>
<!-- configuring the ear plugin -->
<configuration>
<modules>
<!-- all your modles -->
</modules>
</configuration>
</plugin>
</plugins>
Related
I have a Maven project with a JavaFX submodule and it just started giving me an error, I can't find any changes I made to the submodule that might've caused this other than starting a git repository. I think something is wrong with the <build> in the submodule pom, but nothing I tried worked. The submodule pom is mostly generated by IntelliJ.
Parent pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>ChoreSystem</artifactId>
<packaging>pom</packaging>
<version>1.0.1</version>
<modules>
<module>ChoreServer</module>
<module>User</module>
</modules>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
...
</dependencies>
</project>
Submodule pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ChoreSystem</artifactId>
<groupId>org.example</groupId>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>User</artifactId>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17-ea+11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17-ea+11</version>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>ChoreSystem</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.6</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>AppLauncher</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
When I run the User with ```clean javafx:run```
I get this Error:
[ERROR] Failed to execute goal on project User: Could not resolve dependencies for project org.example:User:pom:1.0.1: Failure to find org.example:ChoreSystem:jar:1.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Not clear why submodule User should declare a dependency on the parent pom ChoreSystem which looks like it is there just to run a sequence of child modules. Maybe you meant to declare a dependency on ChoreServer.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.microservice.test</groupId>
<artifactId>wallet-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>wallet-service</name>
<description>Wallet microservices</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
<jackson.version>2.9.0.pr3</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>com.microservice.test</groupId>
<artifactId>common-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I have created a project that is common-service and my every other projects uses classes from this project and it works fine but when create build of projects which uses common-service it throws classnotfoundexception for the classes which are present in common-service.
I have added dependency of common-service in other projects and added this project on build path also.
You didn't provide the pom of common-service. Is it of packaging type jar? Please ensure there is a <packaging>jar</packaging> in the other pom coordinates.
The dependencyManagement tag above is closed, but there is no opening.
I've tried to find a proper solution to my question, but it looks like it is similar to the following one maven assembly include the current project jar in the final zip/tar.
The idea of a project is to have one parent pom and a couple of child ones.
I would like to have 'jar-with-dependencies' for each of child when I will execute 'mvn assembly:single' command from the root level.
So, what I have got so far:
If I execute mvn package and mvn assembly:single one by one, then first will be completed successfully and the second one with a warning that child project was not included. Since my module has not been included, I am not able to launch the target.
If I execute mvn package assembly:single, then required jar with all the dependencies will be created and I am able to launch the target.
I afraid that I have missed a configuration in one of my pom.xml. I will appreciate if someone could help me with that. I am adding a link on GitHub repository with this example.
btw, I'm using maven-assembly-plugin version 3.1.0
Thank you in advance, and I guess, I will need to buy a really good book about Maven.
The key point is disabling assembly execution for parent project: it can be achieved combining <skipAssembly> option, profiles section and properties section.
With the following pom files, it works fine.
Parent pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.slemarchand.samples.jarwithdependencies</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>parent</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<skip.assembly>true</skip.assembly>
</properties>
<modules>
<module>child1</module>
<module>child2</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>${skip.assembly}</skipAssembly>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>jar</id>
<activation>
<file>
<exists>${basedir}/src/main/java</exists>
</file>
</activation>
<properties>
<skip.assembly>false</skip.assembly>
</properties>
</profile>
</profiles>
</project>
Child 1 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.slemarchand.samples.jarwithdependencies</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>child1</artifactId>
<version>1.0-SNAPSHOT</version>
<name>child1</name>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>
Child 2 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.slemarchand.samples.jarwithdependencies</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>child2</artifactId>
<version>1.0-SNAPSHOT</version>
<name>child2</name>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<build>
</build>
</project>
You can find the sample project here: https://gitlab.com/slemarchand/jar-with-dependencies-multi-module-sample.
Thanks for the answers.
It turns out that if was misconfiguration in child pom.xml.
I didn't add definition of the plugin under the plugins section:
<build>
<plugins>
HERE
<plugins>
</build>
So it was properly described under <pluginManagement> and it blinds me...
when I start learning spring boot,I made a project springboot-demo as the root, an three modules admin-service、common-service and dao.
this is root pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<name>springboot-demo</name>
<modules>
<module>admin-service</module>
<module>common-service</module>
<module>dao</module>
</modules>
<groupId>cc.xiaoerbi</groupId>
<artifactId>springboot-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<mybatis-spring-boot>1.2.0</mybatis-spring-boot>
<mysql-connector>5.1.39</mysql-connector>
</properties>
</project>
this is the admin pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>springboot-demo</artifactId>
<groupId>cc.xiaoerbi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<name>admin-service</name>
<artifactId>admin-service</artifactId>
<dependencies>
<dependency>
<groupId>cc.xiaoerbi</groupId>
<artifactId>dao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Spring Boot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
and this is the dao pom:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>springboot-demo</artifactId>
<groupId>cc.xiaoerbi</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>dao</artifactId>
<dependencies>
<!-- Spring Boot Mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
I package admin war failed
told:
[WARNING] The POM for cc.xiaoerbi:dao:jar:1.0-SNAPSHOT is missing, no dependency information available
I've written some similar code, and it work. I don't know what's wrong with this code.
change your module so that you compile your dependecies before using them.
<modules>
<module>dao</module>
<module>admin-service</module>
<module>common-service</module>
</modules>
The folder names that contain the dao, admin-service, and common-service pom.xml shold be in the root folder and they should match the modules names in the root pom.xml. Also, you should run the "mvn clean install" compile from the root directory and not the admin directory. If you compile from admin, it will not compile dao first. It will try to pull in from the repo when it cannot find a resource in the ~/.m2/repositoy local cache.
Add the
<relativePath>../pom.xml</relativePath>
to the admin-service and common-service.
They talk about it in Project Inheritance section example 2 on https://maven.apache.org/guides/introduction/introduction-to-the-pom.html
I have a project-test which contains all classes that are used in JUnit Tests of others projects (e.g builders tests). In pom.xml of project-test I added Mockito and Junit.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.company</groupId>
<artifactId>project-test</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>central</id>
<name>Maven Central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Note that many projects needs to use project-test to import JUnit and Mockito dependency. Foo project has a pom.xml with project-test dependency:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.company</groupId>
<artifactId>foo</artifactId>
<packaging>war</packaging>
<name>foo</name>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<!-- <defaultGoal>install</defaultGoal> -->
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.5.1</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<!-- Nexus config -->
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>br.com.company</groupId>
<artifactId>project-test</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
It needs to import some packages like:
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
I executed mvn clean install and the .jar inside /home/danielamorais/.m2/repository/br/com/company/project-test/1.0-SNAPSHOT exists. Why I can't import Junit and Mockito in my Foo Project?
Error:(8, 17) java: package org.junit does not exist
Those are test scope dependencies and will only be applicable when running the test.
I hope you are testing this by executing the mvn test.
ex mvn -Dtest=YourTestCase test
Like JB Nizet and Nrj mentioned, it's a matter of scopes. Check Maven documentation on the subject.
I just wanted to add that instead of creating a whole new project for grouping your common dependencies, a simpler and common practice is to create a parent POM then your other POMs can inherit from it. Read more about it here, there are a couple examples.
As an artifact declare as dependency another artifact, dependencies with the test scope are not inherited in the declaring artifact.
If what you want is defining common dependencies (and same common configuration) for multiple artifacts, use the feature designed to : the parent pom.
Define a parent pom that holds common configuration and make your two artifacts some child modules of it.
You may also make the parent pom a aggregator/multi-module pom if required.
Parent pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.company</groupId>
<artifactId>foo-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>central</id>
<name>Maven Central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
project-test (jar)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>br.com.company</groupId>
<artifactId>foo-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>project-test</artifactId>
</project>
foo (war app)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>br.com.company</groupId>
<artifactId>foo-parent</artifactId>
<version>1.0</version>
</parent>
<packaging>war</packaging>
<artifactId>foo</artifactId>
</project>