BevynQ
BevynQ

Reputation: 8254

SkinnyWars importing conflicting snapshots

I am using the maven-ear-plugin to build an ear file with skinny wars.

I am working with another team that provides daily snapshots And what I am getting is the situation if I have not built snapshots locally then

The ear file has the daily builds (which is good) and the war files have my most recent snapshot (which is not good).

e.g. the ear file will have imported1-2017-010101.jar and the war file will have imported1-SNAPSHOT.jar

It seems that this is happening due to the daily build having a date stamp in their name while the snapshot does not.

If I build snapshots of the imported libraries prior to building the ear file. e.g. the ear file will have imported1-SNAPSHOT.jar and the war file will not have the library.

this is the ear configuration

<profile>
  <id>skinny</id>
  <activation>
    <property>
      <name>!skinny</name>
    </property>
  </activation>
  <dependencies>
    <dependency>
      <groupId>my.library</groupId>
      <artifactId>war-1</artifactId>
      <type>pom</type>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>my.library</groupId>
      <artifactId>war-2</artifactId>
      <type>pom</type>
      <version>${project.version}</version>
    </dependency>

  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <defaultLibBundleDir>/lib</defaultLibBundleDir>
          <skinnyWars>true</skinnyWars>
        </configuration>
      </plugin>
    </plugins>
  </build>
</profile>

Have I got something wrong or does the plugin just not work in this case?

Upvotes: 0

Views: 105

Answers (1)

Sebasti&#227;o Santos
Sebasti&#227;o Santos

Reputation: 191

I resolved this by reviewing my Maven Repository snapshot behaviour.

I'm using Artifactory as maven Repository. It allows you to choose between 3 different behaviours to name you Snapshot, one of them using timestamp, other using -SNAPSHOT, and other accept the deployer choosen name.

I've changed my snapshot behaviour to -SNAPSHOT, removed older versions of snapshots from repository (I don't know if this is really necessary), and skinnyWars are now created correctly.

[]'s

Upvotes: 1

Related Questions