You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jzhang <jz...@wellington.com> on 2007/08/22 19:28:05 UTC

Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

I am using Maven 2.0.7. In my ear file, I have a ejb jar (called core.jar)
that depends on common.jar. They are all in the same ear. I want to have
core.jar manifest.mf file have Class-Path entry for common.jar. But I can
not get that work. I follow maven-ejb-plugin instruction:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                    <!--<generateClient>true</generateClient>-->
                </configuration>
            </plugin>

And I ran: mvn install. The new generated ejb jar file's manifest does not
have Class-Path entry. Besides, I want to add common.jar to this path. Then
I add:

<dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>my-common</artifactId>
            <version>${pom.version}</version>
          
           <properties>
        		<ejb.manifest.classpath>true</ejb.manifest.classpath>
      		</properties>
      	 	
        </dependency>

Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
seen ...\r\n            <properties>... @18:25' error.

It seems I can not put <properties> tag in <dependency> element. What is
wrong?
-- 
View this message in context: http://www.nabble.com/Having-trouble-using-maven-ejb-plugin----can%27t-get-Class-Path-in-manifest-tf4312954s177.html#a12279296
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: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by Tim Kettler <ti...@udo.edu>.
jzhang schrieb:
> Thanks Tim. I do have these two sites. I searched my local repo and the
> ejb-plugin is the latest one: 2.1. I also found the release notes for this
> release:http://www.nabble.com/-ANN--Maven-Ejb-Plugin-2.1-released-tf3208223s177.html#a8909122.
> If I am reading correctly this manifest is still a bug in this release: 
> 
> ** Bug 
>    * [MEJB-7] - Transitive Classpath not written to the manifest 
> ....

You misunderstood the meaning. The release announcement lists the 
workitems included in the release. So the bugs listed are actually fixed 
in this release.

> Not sure what to do with it. I might want to try using jar plugin. Any help
> is appreciated.
>    
> 
> Tim Kettler wrote:
>> jzhang schrieb:
>>> Tim Kettler wrote:
>>>> Hi,
>>>>
>>>> jzhang schrieb:
>>>>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>>>>> core.jar)
>>>>> that depends on common.jar. They are all in the same ear. I want to
>>>>> have
>>>>> core.jar manifest.mf file have Class-Path entry for common.jar. But I
>>>>> can
>>>>> not get that work. I follow maven-ejb-plugin instruction:
>>>>>
>>>>> <plugin>
>>>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>>>                 <artifactId>maven-ejb-plugin</artifactId>
>>>>>                 <configuration>
>>>>>                     <archive>
>>>>>                         <manifest>
>>>>>                             <addClasspath>true</addClasspath>
>>>>>                         </manifest>
>>>>>                     </archive>
>>>>>                     <!--<generateClient>true</generateClient>-->
>>>>>                 </configuration>
>>>>>             </plugin>
>>>>>
>>>>> And I ran: mvn install. The new generated ejb jar file's manifest does
>>>>> not
>>>>> have Class-Path entry.
>>>> Your configuration looks correct and should work. However since 
>>>> <addClasspath/> adds classpath entries for dependencies of your project 
>>>> to the manifest and you seem not to have declared dependencies it may be 
>>>> that maven omits the empty classpath entry.
>>>>
>>>>> Besides, I want to add common.jar to this path. Then I add:
>>>>>
>>>>> <dependency>
>>>>>             <groupId>${pom.groupId}</groupId>
>>>>>             <artifactId>my-common</artifactId>
>>>>>             <version>${pom.version}</version>
>>>>>           
>>>>>            <properties>
>>>>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>>>>       		</properties>
>>>>>       	 	
>>>>>         </dependency>
>>>>>
>>>>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse
>>>>> error
>>>>> reading POM. Reason: Unrecognised tag: 'properties' (position:
>>>>> START_TAG
>>>>> seen ...\r\n            <properties>... @18:25' error.
>>>>>
>>>>> It seems I can not put <properties> tag in <dependency> element. What
>>>>> is
>>>>> wrong?
>>>> It's just as you say: you can't put a <properties/> tag into an 
>>>> dependency element. I think maven 1 had such a syntax but not maven 2. 
>>>> See [1] and [2] for a reference for the pom.
>>>>
>>>> -Tim
>>>>
>>>> [1] http://maven.apache.org/pom.html
>>>> [2] http://maven.apache.org/ref/current/maven-model/maven.html
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>> Thanks for the feedback. From 'maven-ejb-plugin' page, I found this FAQ:
>>> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html. It dose not
>>> have
>>> any entry for which dependency should be added to Class-Path. I thought
>>> it
>>> should be added in that dependency declaration as 'properties'. But I got
>>> error. One question -- how do I know if this plugin is installed? I did
>>> not
>>> do anything but downloaded Maven 2.0.7.
>> Maven automatically downloads all needed plugins. You can think of a 
>> plugin as just a special kind of dependency. Ultimatly it's just a jar 
>> in the central repository. As long as you don't see errors like this, 
>> everything is ok:
>>
>> [ERROR] BUILD ERROR
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] The plugin 'org.apache.maven.plugins:maven-jar-plugin' does not 
>> exist or no valid version could be found
>>
>> If you really want to check if the plugin was downloaded just check your 
>> local repository if the jar for the plugin is present.
>>
>> To learn about the concepts and usage of maven2 I suggest reading the 
>> two good (and free) available books from Sonatype [1] and DevZuz [2].
>>
>> -Tim
>>
>> [1] http://www.sonatype.com/book/
>> [2] http://www.devzuz.com/web/guest/products/resources#BBWM
>>
>> ---------------------------------------------------------------------
>> 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


Re: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by Tim Kettler <ti...@udo.edu>.
Create a test project with the following pom (you have to create a test 
class under 'src/main/java' too. Just 'public class TestClass {}' will 
do) and do 'mvn package'. The manifest in the created jar will have a 
classpath entry with all dependencies (including transitive) listed:

<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>my-test-group</groupId>
   <artifactId>my-test-ejb</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>ejb</packaging>

   <dependencies>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <version>1.1</version>
     </dependency>
   </dependencies>

   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-ejb-plugin</artifactId>
         <configuration>
           <ejbVersion>3.0</ejbVersion>
           <archive>
             <manifest>
               <addClasspath>true</addClasspath>
             </manifest>
           </archive>
         </configuration>
       </plugin>
     </plugins>
    </build>
</project>

jzhang schrieb:
> Thanks Tim. I do have these two sites. I searched my local repo and the
> ejb-plugin is the latest one: 2.1. I also found the release notes for this
> release:http://www.nabble.com/-ANN--Maven-Ejb-Plugin-2.1-released-tf3208223s177.html#a8909122.
> If I am reading correctly this manifest is still a bug in this release: 
> 
> ** Bug 
>    * [MEJB-7] - Transitive Classpath not written to the manifest 
> ....
> 
> Not sure what to do with it. I might want to try using jar plugin. Any help
> is appreciated.
>    
> 
> Tim Kettler wrote:
>> jzhang schrieb:
>>> Tim Kettler wrote:
>>>> Hi,
>>>>
>>>> jzhang schrieb:
>>>>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>>>>> core.jar)
>>>>> that depends on common.jar. They are all in the same ear. I want to
>>>>> have
>>>>> core.jar manifest.mf file have Class-Path entry for common.jar. But I
>>>>> can
>>>>> not get that work. I follow maven-ejb-plugin instruction:
>>>>>
>>>>> <plugin>
>>>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>>>                 <artifactId>maven-ejb-plugin</artifactId>
>>>>>                 <configuration>
>>>>>                     <archive>
>>>>>                         <manifest>
>>>>>                             <addClasspath>true</addClasspath>
>>>>>                         </manifest>
>>>>>                     </archive>
>>>>>                     <!--<generateClient>true</generateClient>-->
>>>>>                 </configuration>
>>>>>             </plugin>
>>>>>
>>>>> And I ran: mvn install. The new generated ejb jar file's manifest does
>>>>> not
>>>>> have Class-Path entry.
>>>> Your configuration looks correct and should work. However since 
>>>> <addClasspath/> adds classpath entries for dependencies of your project 
>>>> to the manifest and you seem not to have declared dependencies it may be 
>>>> that maven omits the empty classpath entry.
>>>>
>>>>> Besides, I want to add common.jar to this path. Then I add:
>>>>>
>>>>> <dependency>
>>>>>             <groupId>${pom.groupId}</groupId>
>>>>>             <artifactId>my-common</artifactId>
>>>>>             <version>${pom.version}</version>
>>>>>           
>>>>>            <properties>
>>>>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>>>>       		</properties>
>>>>>       	 	
>>>>>         </dependency>
>>>>>
>>>>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse
>>>>> error
>>>>> reading POM. Reason: Unrecognised tag: 'properties' (position:
>>>>> START_TAG
>>>>> seen ...\r\n            <properties>... @18:25' error.
>>>>>
>>>>> It seems I can not put <properties> tag in <dependency> element. What
>>>>> is
>>>>> wrong?
>>>> It's just as you say: you can't put a <properties/> tag into an 
>>>> dependency element. I think maven 1 had such a syntax but not maven 2. 
>>>> See [1] and [2] for a reference for the pom.
>>>>
>>>> -Tim
>>>>
>>>> [1] http://maven.apache.org/pom.html
>>>> [2] http://maven.apache.org/ref/current/maven-model/maven.html
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>> Thanks for the feedback. From 'maven-ejb-plugin' page, I found this FAQ:
>>> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html. It dose not
>>> have
>>> any entry for which dependency should be added to Class-Path. I thought
>>> it
>>> should be added in that dependency declaration as 'properties'. But I got
>>> error. One question -- how do I know if this plugin is installed? I did
>>> not
>>> do anything but downloaded Maven 2.0.7.
>> Maven automatically downloads all needed plugins. You can think of a 
>> plugin as just a special kind of dependency. Ultimatly it's just a jar 
>> in the central repository. As long as you don't see errors like this, 
>> everything is ok:
>>
>> [ERROR] BUILD ERROR
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] The plugin 'org.apache.maven.plugins:maven-jar-plugin' does not 
>> exist or no valid version could be found
>>
>> If you really want to check if the plugin was downloaded just check your 
>> local repository if the jar for the plugin is present.
>>
>> To learn about the concepts and usage of maven2 I suggest reading the 
>> two good (and free) available books from Sonatype [1] and DevZuz [2].
>>
>> -Tim
>>
>> [1] http://www.sonatype.com/book/
>> [2] http://www.devzuz.com/web/guest/products/resources#BBWM
>>
>> ---------------------------------------------------------------------
>> 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


Re: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by jzhang <jz...@wellington.com>.
Thanks Tim. I do have these two sites. I searched my local repo and the
ejb-plugin is the latest one: 2.1. I also found the release notes for this
release:http://www.nabble.com/-ANN--Maven-Ejb-Plugin-2.1-released-tf3208223s177.html#a8909122.
If I am reading correctly this manifest is still a bug in this release: 

** Bug 
   * [MEJB-7] - Transitive Classpath not written to the manifest 
....

Not sure what to do with it. I might want to try using jar plugin. Any help
is appreciated.
   

Tim Kettler wrote:
> 
> jzhang schrieb:
>> 
>> Tim Kettler wrote:
>>> Hi,
>>>
>>> jzhang schrieb:
>>>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>>>> core.jar)
>>>> that depends on common.jar. They are all in the same ear. I want to
>>>> have
>>>> core.jar manifest.mf file have Class-Path entry for common.jar. But I
>>>> can
>>>> not get that work. I follow maven-ejb-plugin instruction:
>>>>
>>>> <plugin>
>>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>>                 <artifactId>maven-ejb-plugin</artifactId>
>>>>                 <configuration>
>>>>                     <archive>
>>>>                         <manifest>
>>>>                             <addClasspath>true</addClasspath>
>>>>                         </manifest>
>>>>                     </archive>
>>>>                     <!--<generateClient>true</generateClient>-->
>>>>                 </configuration>
>>>>             </plugin>
>>>>
>>>> And I ran: mvn install. The new generated ejb jar file's manifest does
>>>> not
>>>> have Class-Path entry.
>>> Your configuration looks correct and should work. However since 
>>> <addClasspath/> adds classpath entries for dependencies of your project 
>>> to the manifest and you seem not to have declared dependencies it may be 
>>> that maven omits the empty classpath entry.
>>>
>>>> Besides, I want to add common.jar to this path. Then I add:
>>>>
>>>> <dependency>
>>>>             <groupId>${pom.groupId}</groupId>
>>>>             <artifactId>my-common</artifactId>
>>>>             <version>${pom.version}</version>
>>>>           
>>>>            <properties>
>>>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>>>       		</properties>
>>>>       	 	
>>>>         </dependency>
>>>>
>>>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse
>>>> error
>>>> reading POM. Reason: Unrecognised tag: 'properties' (position:
>>>> START_TAG
>>>> seen ...\r\n            <properties>... @18:25' error.
>>>>
>>>> It seems I can not put <properties> tag in <dependency> element. What
>>>> is
>>>> wrong?
>>> It's just as you say: you can't put a <properties/> tag into an 
>>> dependency element. I think maven 1 had such a syntax but not maven 2. 
>>> See [1] and [2] for a reference for the pom.
>>>
>>> -Tim
>>>
>>> [1] http://maven.apache.org/pom.html
>>> [2] http://maven.apache.org/ref/current/maven-model/maven.html
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>> 
>> 
>> Thanks for the feedback. From 'maven-ejb-plugin' page, I found this FAQ:
>> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html. It dose not
>> have
>> any entry for which dependency should be added to Class-Path. I thought
>> it
>> should be added in that dependency declaration as 'properties'. But I got
>> error. One question -- how do I know if this plugin is installed? I did
>> not
>> do anything but downloaded Maven 2.0.7.
> 
> Maven automatically downloads all needed plugins. You can think of a 
> plugin as just a special kind of dependency. Ultimatly it's just a jar 
> in the central repository. As long as you don't see errors like this, 
> everything is ok:
> 
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] The plugin 'org.apache.maven.plugins:maven-jar-plugin' does not 
> exist or no valid version could be found
> 
> If you really want to check if the plugin was downloaded just check your 
> local repository if the jar for the plugin is present.
> 
> To learn about the concepts and usage of maven2 I suggest reading the 
> two good (and free) available books from Sonatype [1] and DevZuz [2].
> 
> -Tim
> 
> [1] http://www.sonatype.com/book/
> [2] http://www.devzuz.com/web/guest/products/resources#BBWM
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Having-trouble-using-maven-ejb-plugin----can%27t-get-Class-Path-in-manifest-tf4312954s177.html#a12296736
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: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by Tim Kettler <ti...@udo.edu>.
jzhang schrieb:
> 
> Tim Kettler wrote:
>> Hi,
>>
>> jzhang schrieb:
>>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>>> core.jar)
>>> that depends on common.jar. They are all in the same ear. I want to have
>>> core.jar manifest.mf file have Class-Path entry for common.jar. But I can
>>> not get that work. I follow maven-ejb-plugin instruction:
>>>
>>> <plugin>
>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>                 <artifactId>maven-ejb-plugin</artifactId>
>>>                 <configuration>
>>>                     <archive>
>>>                         <manifest>
>>>                             <addClasspath>true</addClasspath>
>>>                         </manifest>
>>>                     </archive>
>>>                     <!--<generateClient>true</generateClient>-->
>>>                 </configuration>
>>>             </plugin>
>>>
>>> And I ran: mvn install. The new generated ejb jar file's manifest does
>>> not
>>> have Class-Path entry.
>> Your configuration looks correct and should work. However since 
>> <addClasspath/> adds classpath entries for dependencies of your project 
>> to the manifest and you seem not to have declared dependencies it may be 
>> that maven omits the empty classpath entry.
>>
>>> Besides, I want to add common.jar to this path. Then I add:
>>>
>>> <dependency>
>>>             <groupId>${pom.groupId}</groupId>
>>>             <artifactId>my-common</artifactId>
>>>             <version>${pom.version}</version>
>>>           
>>>            <properties>
>>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>>       		</properties>
>>>       	 	
>>>         </dependency>
>>>
>>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
>>> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
>>> seen ...\r\n            <properties>... @18:25' error.
>>>
>>> It seems I can not put <properties> tag in <dependency> element. What is
>>> wrong?
>> It's just as you say: you can't put a <properties/> tag into an 
>> dependency element. I think maven 1 had such a syntax but not maven 2. 
>> See [1] and [2] for a reference for the pom.
>>
>> -Tim
>>
>> [1] http://maven.apache.org/pom.html
>> [2] http://maven.apache.org/ref/current/maven-model/maven.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 
> 
> Thanks for the feedback. From 'maven-ejb-plugin' page, I found this FAQ:
> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html. It dose not have
> any entry for which dependency should be added to Class-Path. I thought it
> should be added in that dependency declaration as 'properties'. But I got
> error. One question -- how do I know if this plugin is installed? I did not
> do anything but downloaded Maven 2.0.7.

Maven automatically downloads all needed plugins. You can think of a 
plugin as just a special kind of dependency. Ultimatly it's just a jar 
in the central repository. As long as you don't see errors like this, 
everything is ok:

[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-jar-plugin' does not 
exist or no valid version could be found

If you really want to check if the plugin was downloaded just check your 
local repository if the jar for the plugin is present.

To learn about the concepts and usage of maven2 I suggest reading the 
two good (and free) available books from Sonatype [1] and DevZuz [2].

-Tim

[1] http://www.sonatype.com/book/
[2] http://www.devzuz.com/web/guest/products/resources#BBWM

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


Re: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by jzhang <jz...@wellington.com>.

Tim Kettler wrote:
> 
> Hi,
> 
> jzhang schrieb:
>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>> core.jar)
>> that depends on common.jar. They are all in the same ear. I want to have
>> core.jar manifest.mf file have Class-Path entry for common.jar. But I can
>> not get that work. I follow maven-ejb-plugin instruction:
>> 
>> <plugin>
>>                 <groupId>org.apache.maven.plugins</groupId>
>>                 <artifactId>maven-ejb-plugin</artifactId>
>>                 <configuration>
>>                     <archive>
>>                         <manifest>
>>                             <addClasspath>true</addClasspath>
>>                         </manifest>
>>                     </archive>
>>                     <!--<generateClient>true</generateClient>-->
>>                 </configuration>
>>             </plugin>
>> 
>> And I ran: mvn install. The new generated ejb jar file's manifest does
>> not
>> have Class-Path entry.
> 
> Your configuration looks correct and should work. However since 
> <addClasspath/> adds classpath entries for dependencies of your project 
> to the manifest and you seem not to have declared dependencies it may be 
> that maven omits the empty classpath entry.
> 
>> Besides, I want to add common.jar to this path. Then I add:
>> 
>> <dependency>
>>             <groupId>${pom.groupId}</groupId>
>>             <artifactId>my-common</artifactId>
>>             <version>${pom.version}</version>
>>           
>>            <properties>
>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>       		</properties>
>>       	 	
>>         </dependency>
>> 
>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
>> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
>> seen ...\r\n            <properties>... @18:25' error.
>> 
>> It seems I can not put <properties> tag in <dependency> element. What is
>> wrong?
> 
> It's just as you say: you can't put a <properties/> tag into an 
> dependency element. I think maven 1 had such a syntax but not maven 2. 
> See [1] and [2] for a reference for the pom.
> 
> -Tim
> 
> [1] http://maven.apache.org/pom.html
> [2] http://maven.apache.org/ref/current/maven-model/maven.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


Thanks for the feedback. From 'maven-ejb-plugin' page, I found this FAQ:
http://maven.apache.org/plugins/maven-ejb-plugin/faq.html. It dose not have
any entry for which dependency should be added to Class-Path. I thought it
should be added in that dependency declaration as 'properties'. But I got
error. One question -- how do I know if this plugin is installed? I did not
do anything but downloaded Maven 2.0.7.
-- 
View this message in context: http://www.nabble.com/Having-trouble-using-maven-ejb-plugin----can%27t-get-Class-Path-in-manifest-tf4312954s177.html#a12295668
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: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

jzhang schrieb:
> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called core.jar)
> that depends on common.jar. They are all in the same ear. I want to have
> core.jar manifest.mf file have Class-Path entry for common.jar. But I can
> not get that work. I follow maven-ejb-plugin instruction:
> 
> <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-ejb-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifest>
>                             <addClasspath>true</addClasspath>
>                         </manifest>
>                     </archive>
>                     <!--<generateClient>true</generateClient>-->
>                 </configuration>
>             </plugin>
> 
> And I ran: mvn install. The new generated ejb jar file's manifest does not
> have Class-Path entry.

Your configuration looks correct and should work. However since 
<addClasspath/> adds classpath entries for dependencies of your project 
to the manifest and you seem not to have declared dependencies it may be 
that maven omits the empty classpath entry.

> Besides, I want to add common.jar to this path. Then I add:
> 
> <dependency>
>             <groupId>${pom.groupId}</groupId>
>             <artifactId>my-common</artifactId>
>             <version>${pom.version}</version>
>           
>            <properties>
>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>       		</properties>
>       	 	
>         </dependency>
> 
> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
> seen ...\r\n            <properties>... @18:25' error.
> 
> It seems I can not put <properties> tag in <dependency> element. What is
> wrong?

It's just as you say: you can't put a <properties/> tag into an 
dependency element. I think maven 1 had such a syntax but not maven 2. 
See [1] and [2] for a reference for the pom.

-Tim

[1] http://maven.apache.org/pom.html
[2] http://maven.apache.org/ref/current/maven-model/maven.html

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


Re: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by jzhang <jz...@wellington.com>.
Tim,

I think you are right. The project set up has more than I need for EJB. I
will double check the dependencies. But I still the plugin provides some
sort of selection mechanism.

J

 

Tim Kettler wrote:
> 
> I don't know a way to do this. Why do you want to do this at all? Either 
> your jar depends on a other jar, then you declare it in a dependency and 
> it ends up in the classpath entry or you dont't depend on it, then just 
> don't declare the dependency at all.
> 
> -Tim
> 
> jzhang schrieb:
>> Tim,
>> 
>> You are right. I had <packaging>jar</packaging> instead of
>> <packaging>ejb</packaging> so the ejb-plugin did not get executed. Now
>> all
>> dependencies are in calss-path. Is there anyway I can select some of
>> them? I
>> don't think <includes> works here.
>> 
>> Thanks,
>> 
>> J
>> 
>> 
>> 
>> jzhang wrote:
>>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called
>>> core.jar)
>>> that depends on common.jar. They are all in the same ear. I want to have
>>> core.jar manifest.mf file have Class-Path entry for common.jar. But I
>>> can
>>> not get that work. I follow maven-ejb-plugin instruction:
>>>
>>> <plugin>
>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>                 <artifactId>maven-ejb-plugin</artifactId>
>>>                 <configuration>
>>>                     <archive>
>>>                         <manifest>
>>>                             <addClasspath>true</addClasspath>
>>>                         </manifest>
>>>                     </archive>
>>>                     <!--<generateClient>true</generateClient>-->
>>>                 </configuration>
>>>             </plugin>
>>>
>>> And I ran: mvn install. The new generated ejb jar file's manifest does
>>> not
>>> have Class-Path entry. Besides, I want to add common.jar to this path.
>>> Then I add:
>>>
>>> <dependency>
>>>             <groupId>${pom.groupId}</groupId>
>>>             <artifactId>my-common</artifactId>
>>>             <version>${pom.version}</version>
>>>           
>>>            <properties>
>>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>>       		</properties>
>>>       	 	
>>>         </dependency>
>>>
>>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse
>>> error
>>> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
>>> seen ...\r\n            <properties>... @18:25' error.
>>>
>>> It seems I can not put <properties> tag in <dependency> element. What is
>>> wrong?
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Having-trouble-using-maven-ejb-plugin----can%27t-get-Class-Path-in-manifest-tf4312954s177.html#a12313575
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: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by Tim Kettler <ti...@udo.edu>.
I don't know a way to do this. Why do you want to do this at all? Either 
your jar depends on a other jar, then you declare it in a dependency and 
it ends up in the classpath entry or you dont't depend on it, then just 
don't declare the dependency at all.

-Tim

jzhang schrieb:
> Tim,
> 
> You are right. I had <packaging>jar</packaging> instead of
> <packaging>ejb</packaging> so the ejb-plugin did not get executed. Now all
> dependencies are in calss-path. Is there anyway I can select some of them? I
> don't think <includes> works here.
> 
> Thanks,
> 
> J
> 
> 
> 
> jzhang wrote:
>> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called core.jar)
>> that depends on common.jar. They are all in the same ear. I want to have
>> core.jar manifest.mf file have Class-Path entry for common.jar. But I can
>> not get that work. I follow maven-ejb-plugin instruction:
>>
>> <plugin>
>>                 <groupId>org.apache.maven.plugins</groupId>
>>                 <artifactId>maven-ejb-plugin</artifactId>
>>                 <configuration>
>>                     <archive>
>>                         <manifest>
>>                             <addClasspath>true</addClasspath>
>>                         </manifest>
>>                     </archive>
>>                     <!--<generateClient>true</generateClient>-->
>>                 </configuration>
>>             </plugin>
>>
>> And I ran: mvn install. The new generated ejb jar file's manifest does not
>> have Class-Path entry. Besides, I want to add common.jar to this path.
>> Then I add:
>>
>> <dependency>
>>             <groupId>${pom.groupId}</groupId>
>>             <artifactId>my-common</artifactId>
>>             <version>${pom.version}</version>
>>           
>>            <properties>
>>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>>       		</properties>
>>       	 	
>>         </dependency>
>>
>> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
>> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
>> seen ...\r\n            <properties>... @18:25' error.
>>
>> It seems I can not put <properties> tag in <dependency> element. What is
>> wrong?
>>
> 


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


Re: Having trouble using maven-ejb-plugin -- can't get Class-Path in manifest

Posted by jzhang <jz...@wellington.com>.
Tim,

You are right. I had <packaging>jar</packaging> instead of
<packaging>ejb</packaging> so the ejb-plugin did not get executed. Now all
dependencies are in calss-path. Is there anyway I can select some of them? I
don't think <includes> works here.

Thanks,

J



jzhang wrote:
> 
> I am using Maven 2.0.7. In my ear file, I have a ejb jar (called core.jar)
> that depends on common.jar. They are all in the same ear. I want to have
> core.jar manifest.mf file have Class-Path entry for common.jar. But I can
> not get that work. I follow maven-ejb-plugin instruction:
> 
> <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-ejb-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifest>
>                             <addClasspath>true</addClasspath>
>                         </manifest>
>                     </archive>
>                     <!--<generateClient>true</generateClient>-->
>                 </configuration>
>             </plugin>
> 
> And I ran: mvn install. The new generated ejb jar file's manifest does not
> have Class-Path entry. Besides, I want to add common.jar to this path.
> Then I add:
> 
> <dependency>
>             <groupId>${pom.groupId}</groupId>
>             <artifactId>my-common</artifactId>
>             <version>${pom.version}</version>
>           
>            <properties>
>         		<ejb.manifest.classpath>true</ejb.manifest.classpath>
>       		</properties>
>       	 	
>         </dependency>
> 
> Then I got 'org.apache.maven.reactor.MavenExecutionException: Parse error
> reading POM. Reason: Unrecognised tag: 'properties' (position: START_TAG
> seen ...\r\n            <properties>... @18:25' error.
> 
> It seems I can not put <properties> tag in <dependency> element. What is
> wrong?
> 

-- 
View this message in context: http://www.nabble.com/Having-trouble-using-maven-ejb-plugin----can%27t-get-Class-Path-in-manifest-tf4312954s177.html#a12297923
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