[ 
http://jira.codehaus.org/browse/MJBOSSPACK-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151042#action_151042
 ] 

sbivol edited comment on MJBOSSPACK-9 at 10/16/08 2:58 PM:
-----------------------------------------------------------------

I've also been struggling with building a project (also a jboss-sar) with a 
jboss-sar dependency. I downloaded the 2.0-beta-1 source and built the plugin 
and tests with no errors. 

Noticed that there is a sar-multi-module-classpath test which tests exactly my 
case - a sar that consumes another sar. So I toyed with this test a little, 
since I was curious why it builds successfully. I built this test from its top 
folder (sar-multi-module-classpath), it was OK. 

Then I cleaned and installed only module-a, from module-a folder. It was OK. 
Switched to module-b folder and tried building it. And it failed, with same 
error I'm getting in my project.

After investigating a bit maven's debug output (-X), it seems that:

a) when I build the entire test (from the top folder), for the compile step of 
module-b the classpath contains module-b/target/classes (not the module-a.sar 
file), here is the output:
[DEBUG] Classpath:
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-b\target\classes
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-a\target\classes

b) when I build just module-b from its folder, the classpath contains the 
module-a sar, and this is when compilation fails, here is the output:
[DEBUG] Classpath:
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-b\target\classes
[DEBUG]  C:\Documents and 
Settings\sbivol\.m2\repository\org\codehaus\mojo\tests\module-a\1.0-SNAPSHOT\module-a-1.0-SNAPSHOT.sar

I've been strugling with this issue for the last 2 days, please let me know if 
there's a way around the problem.

On a side note, it seems since java 1.5.0_04 anything on the classpath that is 
not a jar, zip or /* is ignored. Here is a link to an thread discussing this 
http://marc.info/?l=ant-user&m=117242294902291&w=2. I've tried 1.5.0_14 and 
_15, both failed, however, with 1.6.0_10 building module-b worked!

      was (Author: sbivol):
    I've also been struggling with building a project (also a jboss-sar) with a 
jboss-sar dependency. I downloaded the 2.0-beta-1 source and built the plugin 
and tests with no errors. 

Noticed that there is a sar-multi-module-classpath test which tests exactly my 
case - a sar that consumes another sar. So I toyed with this test a little, 
since I was curious why it builds successfully. I built this test from its top 
folder (sar-multi-module-classpath), it was OK. 

Then I cleaned and installed only module-a, from module-a folder. It was OK. 
Switched to module-b folder and tried building it. And it failed, with same 
error I'm getting in my project.

After investigating a bit maven's debug output (-X), it seems that:

a) when I build the entire test (from the top folder), for the compile step of 
module-b the classpath contains module-b/target/classes (not the module-a.sar 
file), here is the output:
[DEBUG] Classpath:
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-b\target\classes
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-a\target\classes

b) when I build just module-b from its folder, the classpath contains the 
module-a sar, and this is when compilation fails, here is the output:
[DEBUG] Classpath:
[DEBUG]  
C:\sergiu\temp\jboss-packaging-maven-plugin\target\it\sar-multi-module-classpath\module-b\target\classes
[DEBUG]  C:\Documents and 
Settings\sbivol\.m2\repository\org\codehaus\mojo\tests\module-a\1.0-SNAPSHOT\module-a-1.0-SNAPSHOT.sar

I've been strugling with this issue for the last 2 days, please let me know if 
there's a way around the problem.

On a side note, it seems since java 1.5.0_04 anything on the classpath that is 
not a jar, zip or /* is ignored. Here is a link to an thread discussing this 
http://marc.info/?l=ant-user&m=117242294902291&w=2. So perhaps this explains 
why compile fails.
  
> Dependency to project with packaging-type 'jboss-sar' doesn't work
> ------------------------------------------------------------------
>
>                 Key: MJBOSSPACK-9
>                 URL: http://jira.codehaus.org/browse/MJBOSSPACK-9
>             Project: Maven 2.x JBoss Packaging Plugin
>          Issue Type: Bug
>          Components: sar
>            Reporter: Christian Presslmayr
>             Fix For: 2.0
>
>
> Hi!
> In my multi-module environment I have the following problem: 
> - I have several projects, where one is dependent on another one, let's say 
> project B is dependent on A. 
> - Both projects have packaging-type 'jboss-sar'.
> - Project A compiles successfully, also the .sar file is created on mvn 
> install
> - But compile for project B doesn't succeed, because it can't resolve the 
> dependency to project A, i. e. it doesn't find the classes of project A, 
> therefore I get an compile error. I defined this dependency in B's pom.xml as 
> follows:
>     <dependency>
>       <groupId>mygroup</groupId>
>       <artifactId>A</artifactId>
>       <version>${project.version}</version>
>       <type>jboss-sar</type>
>       <scope>provided</scope>
>     </dependency>
> I defined the scope 'provided', because I don't want the dependency to be 
> packed into B's sar-file. But this seems is not the problem, because when 
> omitting the scope, it doesn't work either.
> So it seems to me, that there's something wrong with the dependency mechanism 
> for projects of type jboss-sar.
> Or am I missing some setting? Any help is appreciated!
> Thanks,
> Chris

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to