You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by david varnes <li...@varnes.net> on 2005/11/15 12:13:02 UTC

Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...

Hi Vincent,

Is the Cargo M2 plugin released anywhere, or is it only available
in the beetlejuice ci 0.7-snapshot builds ?

thanks
davidv


Vincent Massol wrote:

[snip]

> OTOH, it is possible to use tools like the Cargo m2 plugin in the WAR or EAR
> component projects to perform integration tests using a *default*
> configuration. 

[snap]

> Thanks
> -Vincent

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


Re: Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...

Posted by Nick Sieger <ni...@gmail.com>.
We are close to finishing it but we need some testers before we release it.

> In addition it's currently based on Cargo 0.7 snapshots.
>
> I'm making it available today as a snapshot version in a m2 repository on
> codehaus. In order to use it you'd simply need to add that repository to
> your pom.xml or settings.xml. Would you be interested in trying it out?
>
> What containers are you interested in? (just want to verify the ones
> you're
> interested in are working with the cargo 0.7 snapshot build that I plan to
> publish ;-)).



I'm hoping to start using M2 Cargo in the near future for OC4J. If OC4J
support is trailing the others I'd probably be willing to pitch in and get
it up to speed.

/Nick

Integration-test and, classpath etc

Posted by Pablo <pa...@tiger.com.pl>.
Hello there

I'm struggling with maven to make him work the way I want.

I've written a plugin which has two goals:
1) testCompile - compiles tests to be executed during integration-test 
phase.
2) test - starts tomcat, run tests and stops tomcat

In all jars associated with tests there is a 'test scope' set.
Normal tests (junit tests) which are run in the 'test-compile phase' are 
compiled without errors. These tests are based on StrutsTestCase which 
are based on JUnit.
Somehow junit.jar is included in classpath during compilation and 
execution of these tests.
It's fine.

And now, my plugin wants to compile integration tests and then run them.
The first goal 'testCompile' has the following attributes
 * @goal testCompile
 * @phase test-compile
 * @requiresDependencyResolution test

However, all jars which have scope set to test are not present in the 
classpath. Why?
There is no httpunit, htmlunit, junit etc.

Could some one tell me what I'm doing wrong and what I should do to make 
it work?

Cheers
Pablo

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


Re: problems with Integration-test and plexus compiler

Posted by Jesse McConnell <je...@gmail.com>.
I needed to do a bit of compiling after the process-classes phase for a
couple of custom plugins...so I pulled out the interesting parts of the
compiler mojo and used that...not sure if there is a better way, but this
certainly works..

jesse



private Compiler compiler = new JavacCompiler();



private void compile(String file) throws MojoExecutionException {

getLog().debug("outputDir " + outputDirectory);
getLog().debug("file " + file);
getLog().debug("build to " + buildDirectory);

try {

CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
compilerConfiguration.setOutputLocation( buildDirectory + "/classes" );
ArrayList list = new ArrayList();
list.add(outputDirectory);
compilerConfiguration.setSourceLocations( list );

compilerConfiguration.setClasspathEntries(
project.getCompileClasspathElements() );

HashSet set = new HashSet();
set.add(new File(file));

compilerConfiguration.setSourceFiles( set );


compilerConfiguration.setDebug( true );

List messages = null;
messages = compiler.compile( compilerConfiguration );
}
catch ( Exception e )
{
e.printStackTrace();
// TODO: don't catch Exception
throw new MojoExecutionException( "Fatal error compiling", e );
}

}

On 11/15/05, Pablo <pa...@tiger.com.pl> wrote:
>
> Hello there
>
> I'm writting a plugin which is supposed to do a few things:
> 1) Compile test classes to be run in integration-test phase
> 2) Start tomcat
> 3) Run tests
> 4) Stop tomcat
>
> Steps 2, 3 and 4 are almost done. The main problem is step 1.
> I thought it would be too much to do by implementing compilation from
> scratch therefore I simply created a class extending TestCompilerMojo
> class.
> Unfortunatelly it doesn't work, throws exception because CompilerManager
> is not initialized. I tried to make it by myself by setting necessary
> field in execute() method (compilerManager, compilerId) and now it
> doesn't throw any exceptions.
>
> In plugin configuration I've placed 'compileSourceRoots' and
> ''outputDirectory' but it seems that these values are not set because I
> got a message:
> '[INFO] No sources to compile'
>
> Can someone point me to some tutorial or HOWTO describing all necessary
> steps to make it work?
>
> I don't want to place integration tests in the same directory as normal
> junit tests because these tests are supposed to be run after tomcat is
> started with web application running in the *integration-test* phase not
> the *test* phase. If they were placed in src/tests the *package* phase
> would return error since there would be no webapp running *(test* is
> before *package* phase).
>
> Thanks in advance.
> Pablo
>
>


--
jesse mcconnell
jesseDOTmcconnellATgmailDOTcom

problems with Integration-test and plexus compiler

Posted by Pablo <pa...@tiger.com.pl>.
Hello there

I'm writting a plugin which is supposed to do a few things:
1) Compile test classes to be run in integration-test phase
2) Start tomcat
3) Run tests
4) Stop tomcat

Steps 2, 3 and 4 are almost done. The main problem is step 1.
I thought it would be too much to do by implementing compilation from 
scratch therefore I simply created a class extending TestCompilerMojo class.
Unfortunatelly it doesn't work, throws exception because CompilerManager 
is not initialized. I tried to make it by myself by setting necessary 
field in execute() method (compilerManager, compilerId) and now it 
doesn't throw any exceptions.

In plugin configuration I've placed 'compileSourceRoots' and 
''outputDirectory' but it seems that these values are not set because I 
got a message:
'[INFO] No sources to compile'

Can someone point me to some tutorial or HOWTO describing all necessary 
steps to make it work?

I don't want to place integration tests in the same directory as normal 
junit tests because these tests are supposed to be run after tomcat is 
started with web application running in the *integration-test* phase not 
the *test* phase. If they were placed in src/tests the *package* phase 
would return error since there would be no webapp running *(test* is 
before *package* phase).

Thanks in advance.
Pablo

Re: Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...

Posted by Steve Loughran <st...@apache.org>.
Vincent Massol wrote:
> Hi David,
> 
> 
>>-----Original Message-----
>>From: david varnes [mailto:lists@varnes.net]
>>Sent: mardi 15 novembre 2005 12:13
>>To: Maven Developers List
>>Subject: Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...
>>
>>Hi Vincent,
>>
>>Is the Cargo M2 plugin released anywhere, or is it only available
>>in the beetlejuice ci 0.7-snapshot builds ?
> 
> 
> We are close to finishing it but we need some testers before we release it.
> In addition it's currently based on Cargo 0.7 snapshots.
> 
> I'm making it available today as a snapshot version in a m2 repository on
> codehaus. In order to use it you'd simply need to add that repository to
> your pom.xml or settings.xml. Would you be interested in trying it out?
> 
> What containers are you interested in? (just want to verify the ones you're
> interested in are working with the cargo 0.7 snapshot build that I plan to
> publish ;-)).
> 

give me the URL and I'll test it too.

containers: tomcat5 and jboss4.

-Steve

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


RE: Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...

Posted by Vincent Massol <vm...@pivolis.com>.
Hi David,

> -----Original Message-----
> From: david varnes [mailto:lists@varnes.net]
> Sent: mardi 15 novembre 2005 12:13
> To: Maven Developers List
> Subject: Cargo M2 plugin [was] Re: [M2][Proposal] J2EE builds ...
> 
> Hi Vincent,
> 
> Is the Cargo M2 plugin released anywhere, or is it only available
> in the beetlejuice ci 0.7-snapshot builds ?

We are close to finishing it but we need some testers before we release it.
In addition it's currently based on Cargo 0.7 snapshots.

I'm making it available today as a snapshot version in a m2 repository on
codehaus. In order to use it you'd simply need to add that repository to
your pom.xml or settings.xml. Would you be interested in trying it out?

What containers are you interested in? (just want to verify the ones you're
interested in are working with the cargo 0.7 snapshot build that I plan to
publish ;-)).

Thanks
-Vincent

> Vincent Massol wrote:
> 
> [snip]
> 
> > OTOH, it is possible to use tools like the Cargo m2 plugin in the WAR or
> EAR
> > component projects to perform integration tests using a *default*
> > configuration.
> 
> [snap]
> 
> > Thanks
> > -Vincent
> 
> ---------------------------------------------------------------------
> 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