Maven ACR Plugin
  1. Maven ACR Plugin
  2. MACR-4

<addClasspath>true</addClasspath> includes timestamp instead of the string "-SNAPSHOT" for SNAPSHOT dependencies

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Win 7 Pro SP1 (64 Bit), Maven 3.0.4, ACR 1.0
    • Number of attachments :
      1

      Description

      To reduce the amount of JARs linked to a client application, it is necessary to provide a Class-Path entry in the MANIFEST of the CAR archive. When configuring the ACR to do so using <addClasspath>true</addClasspath>, the created MANIFEST.MF will include the timestamp of a SNAPSHOT dependency, instead of simply the word "-SNAPSHOT". Unfortunately, the EAR plugin is unable to rename the packaged dependencies in the same way, but simply keeps the string "-SNAPSHOT". Effectively this leads to the fact that the Class-Path will not contain the needed JARs at runtime, so the client will except with ClassNotFoundException for any class inside of the SNAPSHOT dependencies.

      Attached you will find a sample POM which produces this problem on my laptop. The sole dependency will be found in the EAR later as "quipsy-defaultgui-4.32.-12-SNAPSHOT.jar", while the MANIFEST.MF of the CAR will have a MANIFEST containing "Class-Path: quipsy-defaultgui-4.32.12-20120312.074725-4.jar".

      Obviously the behaviour of the ACR and EAR plugings are inconsistent, effectively preventing use of the snapshot mechanism of Maven with Jave EE projects.

      1. pom.xml
        1.0 kB
        Markus KARG

        Activity

        Hide
        Benjamin Cartereau added a comment -

        Same issue. The embedded jar (in the ear) is the "-SNAPSHOT" version but the one declared in the classpath of the MANIFEST.MF is the timestamped version...

        Show
        Benjamin Cartereau added a comment - Same issue. The embedded jar (in the ear) is the "-SNAPSHOT" version but the one declared in the classpath of the MANIFEST.MF is the timestamped version...
        Hide
        Benjamin Cartereau added a comment -

        For information, I did fix it by adding and setting the "useUniqueVersions" attribute to false in the ejb plugin:

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
        <archive>
        <manifest>
        <addClasspath>true</addClasspath>
        <useUniqueVersions>false</useUniqueVersions>
        </manifest>
        </archive>
        <generateClient>true</generateClient>
        </configuration>
        </plugin>

        Show
        Benjamin Cartereau added a comment - For information, I did fix it by adding and setting the "useUniqueVersions" attribute to false in the ejb plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <useUniqueVersions>false</useUniqueVersions> </manifest> </archive> <generateClient>true</generateClient> </configuration> </plugin>

          People

          • Assignee:
            Unassigned
            Reporter:
            Markus KARG
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: