maveneargenerate

mvn ear pluging generates 3 artifacts instead of 2


I want "the trick" in maven to avoid the "default generation" of artifacts. I have a pom.xml which generates three artifacts instead of two.

In my pom.xml file I have:

...

  <packaging>ear</packaging>
  <name>project-ear</name>

...

And here the important part:

 <plugins>      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.10</version>
        <executions>            
            <execution>
                <id>fija</id>
                <phase>package</phase>
                <goals>
                    <goal>ear</goal>
                    <goal>generate-application-xml</goal>
                </goals>
                <configuration>
                    <finalName>fe</finalName>

... and same for movil...

<executions>            
            <execution>
                <id>fija</id>
                <phase>package</phase>
                <goals>
                    <goal>ear</goal>
                    <goal>generate-application-xml</goal>
                </goals>
                <configuration>
                    <finalName>fe</finalName>

The generated artifacts were:

But I don´t want "project-ear-1.0.0.ear" to be generated, only the "executions" part I´ve seen here in SO the trick but I cannot found again.


Solution

  • After a lot of search, and thanks to ChatGpt I found the solution:

    Just above the project name one should change ear to pom, so te final solution is:

    pom project-ear