Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2-beta-2
    • Fix Version/s: None
    • Component/s: manifest
    • Labels:
      None
    • Environment:
      Pc - Windows XP sp2
    • Number of attachments :
      0

      Description

      I have a maven's projet multi-module.

      I have a problem when i launch mvn package assembly:assembly

      In the Manifest file, the class path does not generated.

      Pom project

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      	<modelVersion>4.0.0</modelVersion>
      	<groupId>com.ipsis.pacha</groupId>
      	<artifactId>Pacha</artifactId>
      	<packaging>pom</packaging>
      	<version>1.0-SNAPSHOT</version>
      	<name>PACHA</name>
      	
      	<build>
      		<plugins>
      			<plugin>
      				<!-- Tache permettant d'afficher le classpath utilisé lors de l'execution de maven. -->
      				<artifactId>maven-antrun-plugin</artifactId>
      				<executions>
      					<execution>
      						<id>print-maven-runtime-classpath</id>
      						<phase>compile</phase>
      						<configuration>
      							<tasks>
      								<property name="runtime-classpath"
      									refid="maven.runtime.classpath" />
      								<echo
      									message="maven.runtime.classpath=${runtime-classpath}" />
      							</tasks>
      						</configuration>
      						<goals>
      							<goal>run</goal>
      						</goals>
      					</execution>
      					<execution>
      						<id>print-maven-test-classpath</id>
      						<phase>test-compile</phase>
      						<configuration>
      							<tasks>
      								<property name="test-classpath"
      									refid="maven.test.classpath" />
      								<echo
      									message="maven.test.classpath=${test-classpath}" />
      							</tasks>
      						</configuration>
      						<goals>
      							<goal>run</goal>
      						</goals>
      					</execution>
      				</executions>
      			</plugin>
      
      			<plugin>
      				<!-- Version du compilateur et de la JVM cible pour l'execution de l'application -->
      				<artifactId>maven-compiler-plugin</artifactId>
      				<configuration>
      					<!-- On reste en 1.6. -->
      					<source>1.6</source>
      					<target>1.6</target>
      					<meminitial>512m</meminitial>
      					<maxmem>1024m</maxmem>
      					<optimize>true</optimize>
      					<verbose>true</verbose>
      					<fork>true</fork>
      					<executable>${JAVA_HOME}\bin\javac.exe</executable>
      					<compilerVersion>1.6</compilerVersion>
      				</configuration>
      				<dependencies />
      			</plugin>
      
      			<!--  Deploiement -->
      			<plugin>
      				<inherited>true</inherited>
      				<artifactId>maven-deploy-plugin</artifactId>
      				<configuration>
      					<updateReleaseInfo>true</updateReleaseInfo>
      				</configuration>
      			</plugin>
      
      			<!-- Permet de déployer aussitôt la version lors de sa création. -->
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-release-plugin</artifactId>
      				<configuration>
      					<goals>deploy</goals>
      				</configuration>
      			</plugin>
      
      			<!-- Plugin pour les tests unitaires -->
      			<plugin>
      				<artifactId>maven-surefire-plugin</artifactId>
      			</plugin>
      
      			<plugin>
      				<!-- Plugin de generation des fichiers de configuration pour Eclipse -->
      				<artifactId>maven-eclipse-plugin</artifactId>
      				<configuration>
      					<wtpversion>2.0</wtpversion>
      					<!-- Configuration de repertoire de compilation d'Eclipse -->
      					<buildOutputDirectory>
      						/classes
      					</buildOutputDirectory>
      					<downloadSources>false</downloadSources>
      
      					<!-- Ajout des librairies Eclipse -->
      					<classpathContainers>
      						<!-- Ajout du JRE par défaut Eclipse -->
      						<classpathContainer>
      							org.eclipse.jdt.launching.JRE_CONTAINER
      						</classpathContainer>
      					</classpathContainers>
      				</configuration>
      			</plugin>
      
      			<!-- Construction du site -->
      			<plugin>
      				<artifactId>maven-site-plugin</artifactId>
      				<configuration>
      					<locales>fr</locales>
      					<inputEncoding>ISO-8859-1</inputEncoding>
      					<outputEncoding>ISO-8859-1</outputEncoding>
      				</configuration>
      			</plugin>
      
      			<!-- Creation d'un jar unique -->
      			<plugin>
      				<artifactId>maven-assembly-plugin</artifactId>
      				<configuration>
      					<descriptors>
      						<descriptor>assembly/pacha_src.xml</descriptor>						
      					</descriptors>
      					<finalName>${artifactId}-${version}</finalName>
      					<outputDirectory>target</outputDirectory>
      					<archive>
      						<manifest>
      							<mainClass>
      								com.ipsis.pacha.gui.ihm.Main
      							</mainClass>
      							<packageName>com.ipsis.pacha</packageName>
      							<addClasspath>true</addClasspath>
      						</manifest>
      					</archive>
      				</configuration>
      			</plugin>
      		</plugins>
      	</build>
      
      	<dependencyManagement>
      		<dependencies>
      			<!-- Librairie junit -->
      			<dependency>
      				<groupId>junit</groupId>
      				<artifactId>junit</artifactId>
      				<version>4.1</version>
      				<scope>test</scope>
      			</dependency>
      
      			<!-- Log -->
      			<dependency>
      				<groupId>commons-logging</groupId>
      				<artifactId>commons-logging</artifactId>
      				<version>1.1.1</version>
      				<exclusions>
      					<exclusion>
      						<groupId>javax.servlet</groupId>
      						<artifactId>servlet-api</artifactId>
      					</exclusion>
      				</exclusions>
      			</dependency>
      
      			<!-- Commons lang -->
      			<dependency>
      				<groupId>commons-lang</groupId>
      				<artifactId>commons-lang</artifactId>
      				<version>2.3</version>
      				<type>jar</type>
      			</dependency>
      
      			<!-- HiveMind Lie interfaces aux implementations -->
      			<dependency>
      				<groupId>hivemind</groupId>
      				<artifactId>hivemind</artifactId>
      				<version>1.1-rc-1</version>
      			</dependency>
      		</dependencies>
      	</dependencyManagement>
      
      	<!-- Module du projet -->
      	<modules>
      		<module>Common</module>
      		<module>Core</module>
      		<module>TreatmentInterface</module>
      		<module>TreatmentImplementation</module>
      		<module>GUI</module>
      	</modules>
      </project>
      

      File : assembly

      <assembly>
      	<id></id>
      	<formats>
      		<format>jar</format>
      	</formats>
      	<includeBaseDirectory>true</includeBaseDirectory>
      	<baseDirectory>/</baseDirectory>
      	<moduleSets>
      		<moduleSet>
      			<binaries>
      				<outputDirectory>/</outputDirectory>
      				<unpack>true</unpack>
      				<includeDependencies>true</includeDependencies>
      				<dependencySets>
      					<dependencySet>
      						<excludes>
      							<exclude>*:sources</exclude>
      							<exclude>*:jar:*</exclude>
      						</excludes>
      					</dependencySet>
      				</dependencySets>
      			</binaries>
      		</moduleSet>
      	</moduleSets>
      </assembly>
      

        Issue Links

          Activity

          Hide
          Stevo Slavic added a comment -

          Just got hit by this. I'm using maven-assembly-plugin 2.2; addClasspath archive setting doesn't seem to influence (jar format) assembly archive manifest creation. For maven-jar-plugin 2.3.1 it works.

          Debugged a bit. In MavenArchiver, getManifest method, getRuntimeClasspathElements call returns only project build output directory but not dependencies.

          Show
          Stevo Slavic added a comment - Just got hit by this. I'm using maven-assembly-plugin 2.2; addClasspath archive setting doesn't seem to influence (jar format) assembly archive manifest creation. For maven-jar-plugin 2.3.1 it works. Debugged a bit. In MavenArchiver, getManifest method, getRuntimeClasspathElements call returns only project build output directory but not dependencies.
          Hide
          Stevo Slavic added a comment -

          As temporary workaround I'm using maven-war-plugin manifest goal to create manifest file for assemblies - nasty but works for me for now.

          Show
          Stevo Slavic added a comment - As temporary workaround I'm using maven-war-plugin manifest goal to create manifest file for assemblies - nasty but works for me for now.
          Hide
          Ondrej Zizka added a comment -

          Stevo, does that mean that you invoke maven-war-plugin in a jar artifact?

          Show
          Ondrej Zizka added a comment - Stevo, does that mean that you invoke maven-war-plugin in a jar artifact?
          Hide
          Ondrej Zizka added a comment - - edited

          I have the same issue with Maven 2 - unable to make it put classpath to MANIFEST.MF.
          My project's structure is:

          • root
            • core
            • ...
            • assembly - depends on all other modules.
          Show
          Ondrej Zizka added a comment - - edited I have the same issue with Maven 2 - unable to make it put classpath to MANIFEST.MF. My project's structure is: root core ... assembly - depends on all other modules.
          Hide
          Jesper Peterson added a comment -

          I can confirm the problem still there in assembly plugin 2.2.2, and works for jar plugin 2.4.1.

          So as a work-around I'm using copy-dependencies & jar plugin, but while that approach works, the overall effect is 'unattractive'.

          Show
          Jesper Peterson added a comment - I can confirm the problem still there in assembly plugin 2.2.2, and works for jar plugin 2.4.1. So as a work-around I'm using copy-dependencies & jar plugin, but while that approach works, the overall effect is 'unattractive'.
          Hide
          Dmitry Katsubo added a comment -

          <addClasspath>true</addClasspath> does not work for me for v2.4.

          Show
          Dmitry Katsubo added a comment - <addClasspath>true</addClasspath> does not work for me for v2.4.
          Hide
          Martin Schonaker added a comment -

          Doesn't work for me in version 2.2-beta5 in goal "attached".

          I've found a workaround. It works using the deprecated goal assembly. However, that goal doesn't attach the artifact, somehow. I've solved that part with build-helper plugin.

          Show
          Martin Schonaker added a comment - Doesn't work for me in version 2.2-beta5 in goal "attached". I've found a workaround. It works using the deprecated goal assembly. However, that goal doesn't attach the artifact, somehow. I've solved that part with build-helper plugin.

            People

            • Assignee:
              Unassigned
              Reporter:
              Damien
            • Votes:
              11 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated: