No, this is not possible (with the <finalName/> tag). The repository is a structured storage for maven artifacts and the directory hierarchy and filename conventions are well defined. Every artifact in the repository has to adhere to this conventions else maven will not be able to retrieve the artifacts.

However, there is a simple solution (and I don't know why I didn't thought at it in the first place):

Maven has the concept of classifiers to discriminate between different flavours of the same artifact. This is used for things like providing artifacts for different JDK versions or installing the javadoc and source archives alongsite the main artifact. As classifiers are part of the identity of a dependency, they are preserved in the repository.

To cut a long story short, this pom should do what you want:

  <project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>mygroup</groupId>
    <artifactId>myartifact</artifactId>
    <version>0.1-SNAPSHOT</version>

    <profiles>
      <profile>
        <id>profileA</id>
        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <configuration>
                <classifier>profilea</classifier>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </profile>

      <profile>
        <id>profileB</id>
        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <configuration>
                <classifier>profileb</classifier>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </profile>
    </profiles>
  </project>

-Tim

drippy schrieb:
Thanks Tim, that does work when packaging the jar.  Now I realize that I also
need the name to stay when I am running install. Is this an option?
-Ben


Tim Kettler wrote:
Hi,

you can use <build/><finalName/> for this.

-Tim

drippy schrieb:
I have two profiles that I am using.  I'm trying to figure out if there
is a
way to make it so that when I package up a jar file I can specify the
name
of the jar file so that it is identifiable for that profile.

TIA,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to