Quantcast

How can I add path in classpath entry in Manifest file?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How can I add path in classpath entry in Manifest file?

zhaoyi
I have some resource files which should be defined in classpath entry in Manifest.mf in a jar. I found that I can use jar plugin to add dependency on classpath but I can't add a customize path on the classpath. How can I do this with maven?

thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

Alexander Vaysberg
Hi,

you can it's using this tutorial: -
http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
The jar-plugin has many of the properties. It's heir: -
http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.

Alexander Vaysberg

youhaodeyi schrieb:
> I have some resource files which should be defined in classpath entry in
> Manifest.mf in a jar. I found that I can use jar plugin to add dependency on
> classpath but I can't add a customize path on the classpath. How can I do
> this with maven?
>
> thanks.
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

zhaoyi
Hi,

I have read this but this is not what I want. I want to add path on classpath. This only tells me how to add dependent on classpath.


Alexander Vaysberg wrote
Hi,

you can it's using this tutorial: -
http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
The jar-plugin has many of the properties. It's heir: -
http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.

Alexander Vaysberg

youhaodeyi schrieb:
> I have some resource files which should be defined in classpath entry in
> Manifest.mf in a jar. I found that I can use jar plugin to add dependency on
> classpath but I can't add a customize path on the classpath. How can I do
> this with maven?
>
> thanks.
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

Alexander Vaysberg
Hi,

not only. Look heir: - http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html.

Worts:
Java Sun:

    * Class-Path :

      The value of this attribute specifies the relative URLs of the
      extensions or libraries that this application or extension needs.
      URLs are separated by one or more spaces. The application or
      extension class loader uses the value of this attribute to
      construct its internal search path.


That means you can in Manifest only jars added, but not a classpath. The
classpath you mast added if you call the java, or added the jars to
Manifest. That alls.

Alexander Vaysberg

youhaodeyi schrieb:

> Hi,
>
> I have read this but this is not what I want. I want to add path on
> classpath. This only tells me how to add dependent on classpath.
>
>
>
> Alexander Vaysberg wrote:
>  
>> Hi,
>>
>> you can it's using this tutorial: -
>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
>> The jar-plugin has many of the properties. It's heir: -
>> http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.
>>
>> Alexander Vaysberg
>>
>> youhaodeyi schrieb:
>>    
>>> I have some resource files which should be defined in classpath entry in
>>> Manifest.mf in a jar. I found that I can use jar plugin to add dependency
>>> on
>>> classpath but I can't add a customize path on the classpath. How can I do
>>> this with maven?
>>>
>>> thanks.
>>>  
>>>      
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>>    
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

Marco Huber
Hi,

I don't know if this is exactly what you are looking for, but I had to
add a special path to my manifest classpath entry once. The solution was
the following:

<plugin>
   <artifactId>maven-jar-plugin</artifactId>
     <configuration>
       <archive>
         <manifest>
           <addClasspath>true</addClasspath>
           <mainClass>....</mainClass>
         </manifest>
         <manifestEntries>
           <Class-Path>../conf/</Class-Path>
         </manifestEntries>
       </archive>
    </configuration>
</plugin>

This added all the dependencies and the conf path to the classpath.

HTH,
Marco

Alexander Vaysberg wrote:

> Hi,
>
> not only. Look heir: -
> http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html.
>
> Worts:
> Java Sun:
>
>    * Class-Path :
>
>      The value of this attribute specifies the relative URLs of the
>      extensions or libraries that this application or extension needs.
>      URLs are separated by one or more spaces. The application or
>      extension class loader uses the value of this attribute to
>      construct its internal search path.
>
>
> That means you can in Manifest only jars added, but not a classpath. The
> classpath you mast added if you call the java, or added the jars to
> Manifest. That alls.
>
> Alexander Vaysberg
>
> youhaodeyi schrieb:
>> Hi,
>>
>> I have read this but this is not what I want. I want to add path on
>> classpath. This only tells me how to add dependent on classpath.
>>
>>
>>
>> Alexander Vaysberg wrote:
>>  
>>> Hi,
>>>
>>> you can it's using this tutorial: -
>>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
>>> The jar-plugin has many of the properties. It's heir: -
>>> http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.
>>>
>>> Alexander Vaysberg
>>>
>>> youhaodeyi schrieb:
>>>    
>>>> I have some resource files which should be defined in classpath
>>>> entry in
>>>> Manifest.mf in a jar. I found that I can use jar plugin to add
>>>> dependency
>>>> on
>>>> classpath but I can't add a customize path on the classpath. How can
>>>> I do
>>>> this with maven?
>>>>
>>>> thanks.
>>>>        
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>>>    
>>
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

Alexander Vaysberg
Hi,

yes, that right. so you can added the jars to classpath with relative
directory.

Marco Huber schrieb:

> Hi,
>
> I don't know if this is exactly what you are looking for, but I had to
> add a special path to my manifest classpath entry once. The solution
> was the following:
>
> <plugin>
>   <artifactId>maven-jar-plugin</artifactId>
>     <configuration>
>       <archive>
>         <manifest>
>           <addClasspath>true</addClasspath>
>           <mainClass>....</mainClass>
>         </manifest>
>         <manifestEntries>
>           <Class-Path>../conf/</Class-Path>
>         </manifestEntries>
>       </archive>
>    </configuration>
> </plugin>
>
> This added all the dependencies and the conf path to the classpath.
>
> HTH,
> Marco
>
> Alexander Vaysberg wrote:
>> Hi,
>>
>> not only. Look heir: -
>> http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html.
>>
>> Worts:
>> Java Sun:
>>
>>    * Class-Path :
>>
>>      The value of this attribute specifies the relative URLs of the
>>      extensions or libraries that this application or extension needs.
>>      URLs are separated by one or more spaces. The application or
>>      extension class loader uses the value of this attribute to
>>      construct its internal search path.
>>
>>
>> That means you can in Manifest only jars added, but not a classpath.
>> The classpath you mast added if you call the java, or added the jars
>> to Manifest. That alls.
>>
>> Alexander Vaysberg
>>
>> youhaodeyi schrieb:
>>> Hi,
>>>
>>> I have read this but this is not what I want. I want to add path on
>>> classpath. This only tells me how to add dependent on classpath.
>>>
>>>
>>>
>>> Alexander Vaysberg wrote:
>>>  
>>>> Hi,
>>>>
>>>> you can it's using this tutorial: -
>>>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
>>>> The jar-plugin has many of the properties. It's heir: -
>>>> http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.
>>>>
>>>> Alexander Vaysberg
>>>>
>>>> youhaodeyi schrieb:
>>>>  
>>>>> I have some resource files which should be defined in classpath
>>>>> entry in
>>>>> Manifest.mf in a jar. I found that I can use jar plugin to add
>>>>> dependency
>>>>> on
>>>>> classpath but I can't add a customize path on the classpath. How
>>>>> can I do
>>>>> this with maven?
>>>>>
>>>>> thanks.
>>>>>        
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>    
>>>
>>>  
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I add path in classpath entry in Manifest file?

zhaoyi
In reply to this post by Marco Huber
Yes that's what I am looking for.

thanks for all your response.

Zhao Yi
Marco Huber wrote
Hi,

I don't know if this is exactly what you are looking for, but I had to
add a special path to my manifest classpath entry once. The solution was
the following:

<plugin>
   <artifactId>maven-jar-plugin</artifactId>
     <configuration>
       <archive>
         <manifest>
           <addClasspath>true</addClasspath>
           <mainClass>....</mainClass>
         </manifest>
         <manifestEntries>
           <Class-Path>../conf/</Class-Path>
         </manifestEntries>
       </archive>
    </configuration>
</plugin>

This added all the dependencies and the conf path to the classpath.

HTH,
Marco

Alexander Vaysberg wrote:
> Hi,
>
> not only. Look heir: -
> http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html.
>
> Worts:
> Java Sun:
>
>    * Class-Path :
>
>      The value of this attribute specifies the relative URLs of the
>      extensions or libraries that this application or extension needs.
>      URLs are separated by one or more spaces. The application or
>      extension class loader uses the value of this attribute to
>      construct its internal search path.
>
>
> That means you can in Manifest only jars added, but not a classpath. The
> classpath you mast added if you call the java, or added the jars to
> Manifest. That alls.
>
> Alexander Vaysberg
>
> youhaodeyi schrieb:
>> Hi,
>>
>> I have read this but this is not what I want. I want to add path on
>> classpath. This only tells me how to add dependent on classpath.
>>
>>
>>
>> Alexander Vaysberg wrote:
>>  
>>> Hi,
>>>
>>> you can it's using this tutorial: -
>>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html.
>>> The jar-plugin has many of the properties. It's heir: -
>>> http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html.
>>>
>>> Alexander Vaysberg
>>>
>>> youhaodeyi schrieb:
>>>    
>>>> I have some resource files which should be defined in classpath
>>>> entry in
>>>> Manifest.mf in a jar. I found that I can use jar plugin to add
>>>> dependency
>>>> on
>>>> classpath but I can't add a customize path on the classpath. How can
>>>> I do
>>>> this with maven?
>>>>
>>>> thanks.
>>>>        
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>>    
>>
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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