You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tom Lambrechts <To...@telindus.be> on 2007/05/11 22:30:06 UTC

addClasspath does not add the classpath to Manifest

When enabling addClasspath the manifest does not contain classpath.
Neither for runtime or compile scope:
Main class and other parameters do work.

Manifest: 
---------
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: TOLA
Build-Jdk: 1.5.0_07

POM:
--------
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<configuration>
		<archive>
			<manifest>
				<addClasspath>true</addClasspath>
			</manifest>
		</archive>
	</configuration>
</plugin>

Log
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest =
org.apache.maven.archiver.ManifestConfiguration@1e59128
[DEBUG]   (f) archive =
org.apache.maven.archiver.MavenArchiveConfiguration@9ced8e
[DEBUG]   (f) classesDirectory =
D:\Data\workspace_maven\util.telindus.be\target\classes
[DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory =
D:\Data\workspace_maven\util.telindus.be\target
[DEBUG]   (f) project = org.apache.maven.project.MavenProject@26bd8e47
[DEBUG] -- end configuration --
[INFO] [jar:jar]
[DEBUG] isUp2date: false (Input file
D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
[INFO] Building jar:
D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
PSHOT.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory be/
ETC........


Re: addClasspath does not add the classpath to Manifest

Posted by Wayne Fay <wa...@gmail.com>.
Not sure what to tell you, Tom. Here's my results with the same
config; it works for me.

Manifest.mf file:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: WFay
Build-Jdk: 1.5.0_06
Class-Path: jaxme-api-0.3.jar saxon-6.5.3.jar log4j-1.2.12.jar jaxp-ap
 i-1.3.jar xml-apis-1.3.04.jar logkit-1.0.1.jar jstl-1.1.2.jar ..snip..

Pom.xml config:
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>

mvn -X output:
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest = org.apache.maven.archiver.ManifestConfiguration@149eb9f
[DEBUG]   (f) archive =
org.apache.maven.archiver.MavenArchiveConfiguration@c3014
[DEBUG]   (f) classesDirectory =
C:\cvs_root\xyz2.1.2\svn_ecit3\XyzLib\target\classes
[DEBUG]   (f) finalName = xyz-lib-2.1.2-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory = C:\cvs_root\xyz2.1.2\svn_ecit3\XyzLib\target
[DEBUG]   (f) project = org.apache.maven.project.MavenProject@9bf9d61a
[DEBUG] -- end configuration --

Wayne

On 5/11/07, Tom Lambrechts <To...@telindus.be> wrote:
> When enabling addClasspath the manifest does not contain classpath.
> Neither for runtime or compile scope:
> Main class and other parameters do work.
>
> Manifest:
> ---------
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: TOLA
> Build-Jdk: 1.5.0_07
>
> POM:
> --------
> <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-jar-plugin</artifactId>
>        <configuration>
>                <archive>
>                        <manifest>
>                                <addClasspath>true</addClasspath>
>                        </manifest>
>                </archive>
>        </configuration>
> </plugin>
>
> Log
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
> [DEBUG]   (f) addClasspath = true
> [DEBUG]   (s) manifest =
> org.apache.maven.archiver.ManifestConfiguration@1e59128
> [DEBUG]   (f) archive =
> org.apache.maven.archiver.MavenArchiveConfiguration@9ced8e
> [DEBUG]   (f) classesDirectory =
> D:\Data\workspace_maven\util.telindus.be\target\classes
> [DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory =
> D:\Data\workspace_maven\util.telindus.be\target
> [DEBUG]   (f) project = org.apache.maven.project.MavenProject@26bd8e47
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Input file
> D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
> [INFO] Building jar:
> D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
> PSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory be/
> ETC........
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: addClasspath does not add the classpath to Manifest

Posted by Jo Vandermeeren <jo...@gmail.com>.
Hi Tom,

Only dependencies with scope "runtime" are added to the classpath.

Cheers
Jo

On 5/11/07, Tom Lambrechts <To...@telindus.be> wrote:
>
> When enabling addClasspath the manifest does not contain classpath.
> Neither for runtime or compile scope:
> Main class and other parameters do work.
>
> Manifest:
> ---------
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: TOLA
> Build-Jdk: 1.5.0_07
>
> POM:
> --------
> <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>                 <archive>
>                         <manifest>
>                                 <addClasspath>true</addClasspath>
>                         </manifest>
>                 </archive>
>         </configuration>
> </plugin>
>
> Log
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
> [DEBUG]   (f) addClasspath = true
> [DEBUG]   (s) manifest =
> org.apache.maven.archiver.ManifestConfiguration@1e59128
> [DEBUG]   (f) archive =
> org.apache.maven.archiver.MavenArchiveConfiguration@9ced8e
> [DEBUG]   (f) classesDirectory =
> D:\Data\workspace_maven\util.telindus.be\target\classes
> [DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory =
> D:\Data\workspace_maven\util.telindus.be\target
> [DEBUG]   (f) project = org.apache.maven.project.MavenProject@26bd8e47
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Input file
> D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
> [INFO] Building jar:
> D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
> PSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory be/
> ETC........
>
>