That's for the MANIFEST.MF file. Again, you should read the JAR
specification for a description of this file.

Justin 

-----Original Message-----
From: SophosGuy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2008 9:53 AM
To: [email protected]
Subject: Re: Trying to copy additional files to jar


Ok so then what good is the 

 <addClasspath>true</addClasspath>

tag?


Stephen Connolly-2 wrote:
> 
> I suggest you have a look at the jar specification... you'll find that

> jar files do not currently support nested jar files
> 
> 2008/10/1 SophosGuy <[EMAIL PROTECTED]>
> 
>>
>> I am trying to include my dependancy jars in a file inside the jar, 
>> in order to make it easier on users by not requiring making sure 
>> files are in the right place or class path is set up right. So I 
>> first copy all dependancies using the maven-dependency-plugin then I 
>> want to use the maven-jar-plugin to add the classpath to the manifest

>> and then include the jars for these dependancies together.
>>
>>
>> Basically how do I add additional files to the JAR using 
>> maven-jar-plugin?
>>
>> Here is what I am doing
>> <plugin>
>>                    <groupId>org.apache.maven.plugins</groupId>
>>                    <artifactId>maven-dependency-plugin</artifactId>
>>                    <executions>
>>                      <execution>
>>                        <id>copy-dependencies</id>
>>                        <phase>package</phase>
>>                        <goals>
>>                          <goal>copy-dependencies</goal>
>>                        </goals>
>>                        <configuration>
>>
>>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory
>
>>                          <overWriteReleases>false</overWriteReleases>
>>
<overWriteSnapshots>true</overWriteSnapshots>
>>                        </configuration>
>>                      </execution>
>>                    </executions>
>>                  </plugin>
>>          <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-jar-plugin</artifactId>
>>                <version>2.2</version>
>>                <configuration>
>>                    <archive>
>>                        <!--
>>                        <index>true</true>
>>                        -->
>>                        <includes>
>>                            <include>**/classes/lib/*</include>
>>                        </includes>
>>                        <manifest>
>>                            <addClasspath>true</addClasspath>
>>                            <classpathPrefix>lib/</classpathPrefix>
>>
>>
>>                        </manifest>
>>                    </archive>
>>                </configuration>
>>            </plugin>
>>
>> This throws me an error
>>
>> [INFO]
>> ---------------------------------------------------------------------
>> ---
>> [ERROR] BUILD ERROR
>> [INFO]
>> ---------------------------------------------------------------------
>> --- [INFO] Failed to configure plugin parameters for:
>> org.apache.maven.plugins:maven-jar-plugin:2.2
>>
>>
>>
>> Cause: Cannot find setter nor field in 
>> org.apache.maven.archiver.MavenArchiveConfiguration for 'includes'
>> [INFO]
>> ---------------------------------------------------------------------
>> ---
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Error
>> configuring:
>> org.apache.maven.plugins:maven-jar-plugin. Reason: Unable to parse 
>> the created DOM for plugin configuration
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:587)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:499)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:478)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:330)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:291)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:142)
>>        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>>        at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>>
>>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>        at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.PluginConfigurationException: 
>> Error
>> configuring: org.apache.maven.plugins:maven-jar-plugin. Reason: 
>> Unable to parse the created DOM for plugin configuration
>>        at
>>
>>
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(Defaul
tPluginManager.java:1288)
>>        at
>>
>>
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPl
uginManager.java:661)
>>        at
>>
>>
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:429)
>>        at
>>
>>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:558)
>>        ... 16 more
>> Caused by:
>>
org.codehaus.plexus.component.configurator.ComponentConfigurationExcepti
on:
>> Cannot find setter nor field in
>> org.apache.maven.archiver.MavenArchiveConfiguration for 'includes'
>>        at
>>
>>
org.codehaus.plexus.component.configurator.converters.ComponentValueSett
er.<init>(ComponentValueSetter.java:68)
>>        at
>>
>>
org.codehaus.plexus.component.configurator.converters.composite.ObjectWi
thFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:13
4)
>>        at
>>
>>
org.codehaus.plexus.component.configurator.converters.composite.ObjectWi
thFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
>>        at
>>
>>
org.codehaus.plexus.component.configurator.converters.ComponentValueSett
er.configure(ComponentValueSetter.java:247)
>>        at
>>
>>
org.codehaus.plexus.component.configurator.converters.composite.ObjectWi
thFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:13
7)
>>        at
>>
>>
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.co
nfigureComponent(BasicComponentConfigurator.java:56)
>>        at
>>
>>
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(Defaul
tPluginManager.java:1282)
>>        ... 19 more
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Trying-to-copy-additional-files-to-jar-tp197607
>> 23p19760723.html Sent from the Maven - Users mailing list archive at 
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

--
View this message in context:
http://www.nabble.com/Trying-to-copy-additional-files-to-jar-tp19760723p
19760959.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to