> From: [email protected] > Date: Thu, 9 Jan 2014 13:06:10 -0600 > Subject: Re: Can't set Class-Path in jar using external manifest file > To: [email protected] > > > I have tried Java 1.6.0_32 and 1.7.0_09. They both behave the same. > > Try this: > create a jar file that you know works with Maven > test to be sure it works > unzip the file > edit the file by hand to swap those 2 lines > zip the file back up, rename to .jar etc > test with JVM > > Just remove Maven entirely from the equation. Does this work or not? > > Wayne > MG>Hi Wayne MG>a quick and dirty test using Earls plugin configuration MG><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <configuration> <forced>true</forced> <archive> <addMavenDescriptor>false</addMavenDescriptor> <index>true</index> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addClasspath>true</addClasspath> <!-- mainClass>com.compuware.istrobe.manager.centralManager.ISMGR</mainClass --> </manifest> </archive> </configuration> </plugin> MG> BASH>org.apache.maven.plugins:maven-jar-plugin:2.2:jar
MG>here is /META-INF/MANIFEST.MF that was generated Built-By: mgainty Build-Jdk: 1.7.0_45 Specification-Title: Maven Dependency Tree Specification-Version: 2.1 Specification-Vendor: The Apache Software Foundation Implementation-Title: Maven Dependency Tree Implementation-Version: 2.1 Implementation-Vendor-Id: org.apache.maven.shared Implementation-Vendor: The Apache Software Foundation Class-Path: commons-logging-1.1.1.jar surefire-junit-2.6.jar surefire- booter-2.6.jar plexus-utils-2.0.6.jar surefire-api-2.10.jar maven-sur efire-common-2.12.4.jar maven-plugin-api-2.0.9.jar maven-plugin-annot ations-3.1.jar maven-artifact-2.0.9.jar maven-toolchain-2.0.9.jar com mons-lang3-3.1.jar maven-common-artifact-filters-1.3.jar maven-projec t-2.2.1.jar maven-settings-2.2.1.jar maven-profile-2.2.1.jar maven-mo del-2.2.1.jar maven-artifact-manager-2.2.1.jar wagon-provider-api-1.0 -beta-6.jar backport-util-concurrent-3.1.jar maven-plugin-registry-2. 2.1.jar plexus-interpolation-1.11.jar plexus-container-default-1.0-al pha-9-stable-1.jar classworlds-1.1-alpha-2.jar maven-repository-metad ata-3.0.4.jar plexus-component-annotations-1.5.5.jar aether-api-1.13. 1.jar aether-api-0.9.0.M2.jar aether-util-0.9.0.M2.jar junit-3.8.1.jar MG>Note1: all of the target/classes were packaged into the jar MG>Note2:the entities in 'Class-Path' are NOT in the jar MG>For that effort I will need to build an "uber-jar" MG>to build uber-jar (a jar with all the jars in classpath) I will need to implement maven-assembly-plugin MG>with <dependencySet> specified with <includes><include>jar1.jar</include><include<jar2.jar></includes> MG>http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet MG>does this help?
