maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Surefire and non-jar artifacts
Date Mon, 15 Feb 2010 19:23:26 GMT
Recall that a conformant rar file has all its classes in embedded jar  
files, so putting the "outside" actual rar file on the classpath  
doesn't give you access to any classes.  If you put classes "loose"  
inside a rar then a compliant j2ca container will probably ignore them.

On Feb 15, 2010, at 9:16 AM, Stephen Connolly wrote:

> Hi,
>
> So the lovely JCA resource adapters (a.k.a. rar files)...
>
> In Maven 2.0.9, these were added to the classpath

What exactly was added to the classpath?

>
> In Maven 2.2.1, these are no longer added to the classpath...
>
> The former made testing resource adapters easy, but causes issues when
> packaging a resource adapter in an EAR...
>
> The later simplifies packaging RAR files inside an EAR (unless
> possibly you want to try for a skinny RAR) but makes testing the code
> that depends on the RAR more complex.
>
> For example, using the lovely openejb, I now have to do:
>
>            <plugin>
>                <artifactId>maven-dependency-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <phase>generate-test-resources</phase>
>                        <goals>
>                            <goal>copy-dependencies</goal>
>                        </goals>
>                        <configuration>
>                            <includeTypes>rar</includeTypes>
>                            <stripVersion>true</stripVersion>
>                            <includeScope>test</includeScope>
>
> <outputDirectory>${project.build.directory}/test-dependencies</ 
> outputDirectory>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>            <plugin>
>                <artifactId>maven-surefire-plugin</artifactId>
>                <configuration>
>                    <additionalClasspathElements>
>
> <additionalClasspathElement>${project.build.directory}/test- 
> dependencies/my-jca-impl.rar</additionalClasspathElement>
>                    </additionalClasspathElements>
>                </configuration>
>            </plugin>

This looks to me as if its putting the rar on the classpath, not the  
jars inside that contain the classes.

>
> Which is just plain ugly...
>
> My first thought was to have an
>
> <additionalClasspathDependencies>
>
> configuration in surefire... but I just know that it would be abused
> like some mad crazy fool... and because it would not be taking part in
> depMgmt, it would cause issues with releasing.... so that's not best
> practice way at all then....
>
> My second thought is to have
>
> <additionalClasspathTypes>
>  <additionalClasspathType>
>    <type>rar</type>
>    <includeTransitive>true</includeTransitive>
>  </additionalClasspathType>
> </additionalClasspathTypes>
>
> So what do people think?

So are you proposing that if you have a rar, war, or ear, including it  
as a dependency will figure out all the jars inside, compute the  
actual internal classpath, and add all these to the maven classpath?   
I have not problem with this but it's unclear to me if that's what you  
are asking for.

thanks
david jencks

>
> -Stephen.
>
> P.S.
>  I've rejected my first plan... if Jason to aproves I'll resurect
> it... otherwise Plan 2 or 3 (TBD)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Mime
View raw message