You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by eyal edri <ey...@gmail.com> on 2010/03/08 10:03:54 UTC

[bug?] Getting null in manifest when using custom

Hello,

i don't know if this a bug or a misuse of the archiver.

when using a custom layout in manifest, i get 'null' for every value i use:

<build>
  <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <!-- define class path and main class -->
            <manifest>
              <addClasspath>true</addClasspath>

 <mainClass>${project.groupId}.${project.artifactId}</mainClass>
              <classpathLayoutType>custom</classpathLayoutType>

<customClasspathLayout>/usr/lib/ctch/java/${artifact.artifactId}</customClasspathLayout>
            </manifest>
          </archive>
        </configuration>
      </plugin>
   </plugins>
 </build>

the manifest.mf:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: eyale
Build-Jdk: 1.6.0_18
Main-Class: com.commtouch.url.unknowns.IncreasePriority
Class-Path: /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null
 /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null /usr/lib/ct
 ch/java/null/null


i'm following the guidelines on the sample page:
http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Custom


-- 
Eyal Edri



-- 
Eyal Edri

Re: [bug?] Getting null in manifest when using custom

Posted by adimor <ba...@gmail.com>.
you should use
<customClasspathLayout>/usr/lib/ctch/java/*$$*{artifact.artifactId}</customClasspathLayout> 
(double '$$')

--
View this message in context: http://maven.40175.n5.nabble.com/bug-Getting-null-in-manifest-when-using-classpathLayoutType-custom-classpathLayoutType-tp127298p4868298.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: [bug?] Getting null in manifest when using custom

Posted by Wayne Fay <wa...@gmail.com>.
> <customClasspathLayout>/usr/lib/ctch/java/${artifact.artifactId}</customClasspathLayout>

1. Does it work if you use .../../a/b instead of your ${...} stuff?
2. Are you sure that you're using the latest version of Jar plugin
etc? I don't see the version included so no way to know.

Wayne

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


Re: [bug?] Getting null in manifest when using custom

Posted by eyal edri <ey...@gmail.com>.
i manged to use the dependency plugin to write a classpath.txt file,
but still i don't know how to access the list of dependencies, so for e.g. ,
i can tell it each dependency is located at it's own dir.

here's the dependency conf:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>build-classpath</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>

 <outputFile>src/main/resources/${artifactId}-classpath.txt</outputFile>
                <prefix>/usr/lib/ctch/java/</prefix>
            </configuration>
          </execution>
        </executions>
      </plugin>



On Tue, Mar 9, 2010 at 10:58 AM, eyal edri <ey...@gmail.com> wrote:

> OK,
>
> after using the -X option , i verifed that jar plugin 2.3 uses archiver
> 2.4:
>
> [DEBUG] Plugin dependencies for:
>
> org.apache.maven.plugins:maven-jar-plugin:2.3
>
> are:
>
> org.apache.maven:maven-plugin-api:jar:2.0.6:runtime
> org.apache.maven:maven-project:jar:2.0.6:runtime
> org.apache.maven:maven-model:jar:2.0.6:runtime
> org.apache.maven:maven-artifact:jar:2.0.6:runtime
> *org.apache.maven:maven-archiver:jar:2.4:runtime*
> org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-12:runtime
> commons-lang:commons-lang:jar:2.1:runtime
> org.codehaus.plexus:plexus-utils:jar:1.4.9:runtime
>
>
> i'm also trying to work out the dependency:build-classpath goal..and see if
> it can create a custom cp.txt file to use instead of the manifest.
>
> Eyal.
>
>
>
> On Tue, Mar 9, 2010 at 10:00 AM, eyal edri <ey...@gmail.com> wrote:
>
>> Hi Wayne,
>>
>> i'm using jar plugin 2.3.
>>
>> i've notice that those new features (custom layout) are implemented in the
>> Archiver plugin ver 2.4 - should i do something to enforce using
>> the archiver ver 2.4?
>>
>> I replaced ${artifact.artifactId} with a fixed string (log4j) and it
>> worked:
>>
>>
>> Manifest-Version: 1.0
>> Archiver-Version: Plexus Archiver
>> Created-By: Apache Maven
>> Built-By: eyale
>> Build-Jdk: 1.6.0_18
>> Main-Class: com.commtouch.url.unknowns.IncreasePriority
>> Class-Path: /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib
>>  /ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j
>>
>> so what is missing here, is a code/param to fetch the list of all the
>> artifact dependencies.
>>
>> my goal is to build a class-path entry in the manifest without the
>> -version suffix every dependency has.
>>
>> Eyal.
>>
>>
>> On Mon, Mar 8, 2010 at 11:03 AM, eyal edri <ey...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> i don't know if this a bug or a misuse of the archiver.
>>>
>>> when using a custom layout in manifest, i get 'null' for every value i
>>> use:
>>>
>>> <build>
>>>   <plugins>
>>>       <plugin>
>>>         <groupId>org.apache.maven.plugins</groupId>
>>>         <artifactId>maven-jar-plugin</artifactId>
>>>         <configuration>
>>>           <archive>
>>>             <!-- define class path and main class -->
>>>             <manifest>
>>>               <addClasspath>true</addClasspath>
>>>
>>>  <mainClass>${project.groupId}.${project.artifactId}</mainClass>
>>>               <classpathLayoutType>custom</classpathLayoutType>
>>>
>>> <customClasspathLayout>/usr/lib/ctch/java/${artifact.artifactId}</customClasspathLayout>
>>>             </manifest>
>>>           </archive>
>>>         </configuration>
>>>       </plugin>
>>>    </plugins>
>>>  </build>
>>>
>>> the manifest.mf:
>>>
>>> Manifest-Version: 1.0
>>> Archiver-Version: Plexus Archiver
>>> Created-By: Apache Maven
>>> Built-By: eyale
>>> Build-Jdk: 1.6.0_18
>>> Main-Class: com.commtouch.url.unknowns.IncreasePriority
>>> Class-Path: /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null
>>>  /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null /usr/lib/ct
>>>  ch/java/null/null
>>>
>>>
>>> i'm following the guidelines on the sample page:
>>>
>>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Custom
>>>
>>>
>>> --
>>> Eyal Edri
>>>
>>>
>>>
>>> --
>>> Eyal Edri
>>>
>>
>>
>>
>> --
>> Eyal Edri
>>
>
>
>
> --
> Eyal Edri
>



-- 
Eyal Edri

Re: [bug?] Getting null in manifest when using custom

Posted by eyal edri <ey...@gmail.com>.
OK,

after using the -X option , i verifed that jar plugin 2.3 uses archiver 2.4:

[DEBUG] Plugin dependencies for:

org.apache.maven.plugins:maven-jar-plugin:2.3

are:

org.apache.maven:maven-plugin-api:jar:2.0.6:runtime
org.apache.maven:maven-project:jar:2.0.6:runtime
org.apache.maven:maven-model:jar:2.0.6:runtime
org.apache.maven:maven-artifact:jar:2.0.6:runtime
*org.apache.maven:maven-archiver:jar:2.4:runtime*
org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-12:runtime
commons-lang:commons-lang:jar:2.1:runtime
org.codehaus.plexus:plexus-utils:jar:1.4.9:runtime


i'm also trying to work out the dependency:build-classpath goal..and see if
it can create a custom cp.txt file to use instead of the manifest.

Eyal.



On Tue, Mar 9, 2010 at 10:00 AM, eyal edri <ey...@gmail.com> wrote:

> Hi Wayne,
>
> i'm using jar plugin 2.3.
>
> i've notice that those new features (custom layout) are implemented in the
> Archiver plugin ver 2.4 - should i do something to enforce using
> the archiver ver 2.4?
>
> I replaced ${artifact.artifactId} with a fixed string (log4j) and it
> worked:
>
>
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: eyale
> Build-Jdk: 1.6.0_18
> Main-Class: com.commtouch.url.unknowns.IncreasePriority
> Class-Path: /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib
>  /ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j
>
> so what is missing here, is a code/param to fetch the list of all the
> artifact dependencies.
>
> my goal is to build a class-path entry in the manifest without the -version
> suffix every dependency has.
>
> Eyal.
>
>
> On Mon, Mar 8, 2010 at 11:03 AM, eyal edri <ey...@gmail.com> wrote:
>
>> Hello,
>>
>> i don't know if this a bug or a misuse of the archiver.
>>
>> when using a custom layout in manifest, i get 'null' for every value i
>> use:
>>
>> <build>
>>   <plugins>
>>       <plugin>
>>         <groupId>org.apache.maven.plugins</groupId>
>>         <artifactId>maven-jar-plugin</artifactId>
>>         <configuration>
>>           <archive>
>>             <!-- define class path and main class -->
>>             <manifest>
>>               <addClasspath>true</addClasspath>
>>
>>  <mainClass>${project.groupId}.${project.artifactId}</mainClass>
>>               <classpathLayoutType>custom</classpathLayoutType>
>>
>> <customClasspathLayout>/usr/lib/ctch/java/${artifact.artifactId}</customClasspathLayout>
>>             </manifest>
>>           </archive>
>>         </configuration>
>>       </plugin>
>>    </plugins>
>>  </build>
>>
>> the manifest.mf:
>>
>> Manifest-Version: 1.0
>> Archiver-Version: Plexus Archiver
>> Created-By: Apache Maven
>> Built-By: eyale
>> Build-Jdk: 1.6.0_18
>> Main-Class: com.commtouch.url.unknowns.IncreasePriority
>> Class-Path: /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null
>>  /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null /usr/lib/ct
>>  ch/java/null/null
>>
>>
>> i'm following the guidelines on the sample page:
>>
>> http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Custom
>>
>>
>> --
>> Eyal Edri
>>
>>
>>
>> --
>> Eyal Edri
>>
>
>
>
> --
> Eyal Edri
>



-- 
Eyal Edri

Re: [bug?] Getting null in manifest when using custom

Posted by eyal edri <ey...@gmail.com>.
Hi Wayne,

i'm using jar plugin 2.3.

i've notice that those new features (custom layout) are implemented in the
Archiver plugin ver 2.4 - should i do something to enforce using
the archiver ver 2.4?

I replaced ${artifact.artifactId} with a fixed string (log4j) and it worked:


Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: eyale
Build-Jdk: 1.6.0_18
Main-Class: com.commtouch.url.unknowns.IncreasePriority
Class-Path: /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib
 /ctch/java/log4j /usr/lib/ctch/java/log4j /usr/lib/ctch/java/log4j

so what is missing here, is a code/param to fetch the list of all the
artifact dependencies.

my goal is to build a class-path entry in the manifest without the -version
suffix every dependency has.

Eyal.


On Mon, Mar 8, 2010 at 11:03 AM, eyal edri <ey...@gmail.com> wrote:

> Hello,
>
> i don't know if this a bug or a misuse of the archiver.
>
> when using a custom layout in manifest, i get 'null' for every value i use:
>
> <build>
>   <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <archive>
>             <!-- define class path and main class -->
>             <manifest>
>               <addClasspath>true</addClasspath>
>
>  <mainClass>${project.groupId}.${project.artifactId}</mainClass>
>               <classpathLayoutType>custom</classpathLayoutType>
>
> <customClasspathLayout>/usr/lib/ctch/java/${artifact.artifactId}</customClasspathLayout>
>             </manifest>
>           </archive>
>         </configuration>
>       </plugin>
>    </plugins>
>  </build>
>
> the manifest.mf:
>
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: eyale
> Build-Jdk: 1.6.0_18
> Main-Class: com.commtouch.url.unknowns.IncreasePriority
> Class-Path: /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null
>  /usr/lib/ctch/java/null/null /usr/lib/ctch/java/null/null /usr/lib/ct
>  ch/java/null/null
>
>
> i'm following the guidelines on the sample page:
>
> http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Custom
>
>
> --
> Eyal Edri
>
>
>
> --
> Eyal Edri
>



-- 
Eyal Edri