0

I want to generate two artifacts (.ear) for one profile with two maven builds. I need that the name of the artifact doesn't contain the project version, I can't do it this way.

I'm trying multiple solutions but none has served to me. I tried to include the tag <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping> or the tag <fileNameMapping>no-version</fileNameMapping> to the configuration tag. I tried to change the maven-ear-plugin version too, with the same result.

This is my configuration:

<finalName>${area}${project.parent.artifactId}</finalName>

<plugin>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.8</version>
    <executions>
        <execution>
            <id>ear-prepro</id>
            <configuration>
                <finalName>${project.parent.artifactId}finalll</finalName>
                <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
                <earSourceDirectory>src/main/resources</earSourceDirectory>
                <displayName>${area}${artifactId}</displayName>
                <fileNameMapping>no-version</fileNameMapping>
                <outputDirectory>${project.build.directory}</outputDirectory>
                <modules>
                    <webModule>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>${project.parent.artifactId}-web</artifactId>
                        <bundleFileName>${project.parent.artifactId}-web.war</bundleFileName>
                        <contextRoot>/${project.parent.artifactId}</contextRoot>
                    </webModule>
                </modules>
            </configuration>
            <goals>
                <goal>ear</goal>
            </goals>
        </execution>
    </executions>
</plugin>

--------------------------
AND THE OTHER EAR CONFIGURATION
----------------------------

<plugin>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.8</version>
    <executions>
        <execution>
            <id>ear-protest</id>
            <configuration>
                <fileNameMapping>no-version</fileNameMapping>
                <finalName>${area}${project.parent.artifactId}-PROTEST</finalName>
                <earSourceDirectory>src/main/resources</earSourceDirectory>
                <displayName>${area}${artifactId}-PROTEST</displayName>
                <outputDirectory>${project.build.directory}/PROTEST</outputDirectory>
                <modules>
                    <webModule>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>${project.parent.artifactId}-web</artifactId>
                        <bundleFileName>${project.parent.artifactId}-web.war</bundleFileName>
                        <contextRoot>/${project.parent.artifactId}</contextRoot>
                    </webModule>
                </modules>
            </configuration>
            <goals>
                <goal>ear</goal>
            </goals>
        </execution>
    </executions>
</plugin>

It seems that the tag concats the version number to the artifact, but I don't need it. I need the name of the artifact without the project version on the .war file.

Some ideas?

Toni Rodriguez
  • 119
  • 2
  • 3
  • 11

0 Answers0