RE: Compiling Multiple Source Trees

2005-10-11 Thread Allison, Bob
These classes are not used in the test cases for the project they are
in.  They are used in test cases for projects that depend on the
project.

-Original Message-
From: Arik Kfir [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 18:35
To: Maven Users List
Subject: Re: Compiling Multiple Source Trees


Are these classes used in your test cases? If so, I think the simplest
solution would be to put them in src/test/java.

Test classes are not put in your final distribution/jars.

On 10/11/05, Allison, Bob [EMAIL PROTECTED] wrote:

 I would like to set things up in a project to compile a set of mock
 objects stored in src/mock/java into target/mock-classes. These
classes
 should NOT be included into target/classes, since these classes are
not
 part of the distribution artifact. They need to be assembled into a
jar
 with a classifier of -mock for use in other project's unit tests.

 I am looking at two possible ways of doing this:

 1) Write a plugin which extends AbstractCompilerMojo. If I do this, I
 guess I need to add the compiler plugin as a dependency. I also need
to
 figure out how to populate the List and Set parameter objects (source
 roots, classpath, includes, excludes) in the plugin configuration
 element.

 2) Add some information to the compiler plugin configuration to add a
 second execution. To do this, I need to figure out how to specify new
 values for the expressions such as ${project.compileSourceRoots}
since
 the actual plugin parameters are read only.

 Does anybody have any suggestions on how to do either of these options
 or perhaps another option to consider?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compiling Multiple Source Trees

2005-10-11 Thread Allison, Bob
I am trying to avoid having an extra 20 or 30 projects, each with one or
two classes in them.

-Original Message-
From: Jay H. Hartley [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 19:41
To: 'Maven Users List'
Subject: RE: Compiling Multiple Source Trees


Alternatively, if the mock objects are intended for use in multiple
projects, define them in their own project. They can then be deployed
like
any other project artifact and can be used in test cases for multiple
other
projects. When deploying the final application, exclude this jar in the
same
way you would exclude junit.jar. 

This was the route I took rather than hassle with maven.xml scripting or
plug-in writing. Stick with the one-artifact-one-project model as much
as
possible.

Jay

-Original Message-
From: Arik Kfir [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 3:35 PM
To: Maven Users List
Subject: Re: Compiling Multiple Source Trees

Are these classes used in your test cases? If so, I think the simplest
solution would be to put them in src/test/java.

Test classes are not put in your final distribution/jars.

On 10/11/05, Allison, Bob [EMAIL PROTECTED] wrote:

 I would like to set things up in a project to compile a set of mock 
 objects stored in src/mock/java into target/mock-classes. These 
 classes should NOT be included into target/classes, since these 
 classes are not part of the distribution artifact. They need to be 
 assembled into a jar with a classifier of -mock for use in other
project's unit tests.

 I am looking at two possible ways of doing this:

 1) Write a plugin which extends AbstractCompilerMojo. If I do this, I 
 guess I need to add the compiler plugin as a dependency. I also need 
 to figure out how to populate the List and Set parameter objects 
 (source roots, classpath, includes, excludes) in the plugin 
 configuration element.

 2) Add some information to the compiler plugin configuration to add a 
 second execution. To do this, I need to figure out how to specify new 
 values for the expressions such as ${project.compileSourceRoots} 
 since the actual plugin parameters are read only.

 Does anybody have any suggestions on how to do either of these options

 or perhaps another option to consider?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compiling Multiple Source Trees

2005-10-11 Thread Allison, Bob
Trying to go down path #1 right now...

I have a plugin mojo which is basically a copy of CompilerMojo, but with
a couple parameters (like source and output directories) adjusted so I
can specify them in the plugin configuration.  Everything compiles fine
but when I try to use the plugin I get a NPE in AbstractCompilerMojo.
It occurs where it is evaluating the compiler ID.  It turns out that the
parameters from AbstractCompilerMojo are not injected into the
plugin.xml file (not surprising since it is not in the same project).

Is there any way to inject extra parameters into the plugin.xml file?

-Original Message-
From: Allison, Bob [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 18:01
To: Maven Users List
Subject: Compiling Multiple Source Trees


I would like to set things up in a project to compile a set of mock
objects stored in src/mock/java into target/mock-classes.  These classes
should NOT be included into target/classes, since these classes are not
part of the distribution artifact.  They need to be assembled into a jar
with a classifier of -mock for use in other project's unit tests.

I am looking at two possible ways of doing this:

1) Write a plugin which extends AbstractCompilerMojo.  If I do this, I
guess I need to add the compiler plugin as a dependency.  I also need to
figure out how to populate the List and Set parameter objects (source
roots, classpath, includes, excludes) in the plugin configuration
element.

2) Add some information to the compiler plugin configuration to add a
second execution.  To do this, I need to figure out how to specify new
values for the expressions such as ${project.compileSourceRoots} since
the actual plugin parameters are read only.

Does anybody have any suggestions on how to do either of these options
or perhaps another option to consider?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Compiling Multiple Source Trees

2005-10-10 Thread Arik Kfir
Are these classes used in your test cases? If so, I think the simplest
solution would be to put them in src/test/java.

Test classes are not put in your final distribution/jars.

On 10/11/05, Allison, Bob [EMAIL PROTECTED] wrote:

 I would like to set things up in a project to compile a set of mock
 objects stored in src/mock/java into target/mock-classes. These classes
 should NOT be included into target/classes, since these classes are not
 part of the distribution artifact. They need to be assembled into a jar
 with a classifier of -mock for use in other project's unit tests.

 I am looking at two possible ways of doing this:

 1) Write a plugin which extends AbstractCompilerMojo. If I do this, I
 guess I need to add the compiler plugin as a dependency. I also need to
 figure out how to populate the List and Set parameter objects (source
 roots, classpath, includes, excludes) in the plugin configuration
 element.

 2) Add some information to the compiler plugin configuration to add a
 second execution. To do this, I need to figure out how to specify new
 values for the expressions such as ${project.compileSourceRoots} since
 the actual plugin parameters are read only.

 Does anybody have any suggestions on how to do either of these options
 or perhaps another option to consider?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Compiling Multiple Source Trees

2005-10-10 Thread Jay H. Hartley
Alternatively, if the mock objects are intended for use in multiple
projects, define them in their own project. They can then be deployed like
any other project artifact and can be used in test cases for multiple other
projects. When deploying the final application, exclude this jar in the same
way you would exclude junit.jar. 

This was the route I took rather than hassle with maven.xml scripting or
plug-in writing. Stick with the one-artifact-one-project model as much as
possible.

Jay

-Original Message-
From: Arik Kfir [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 3:35 PM
To: Maven Users List
Subject: Re: Compiling Multiple Source Trees

Are these classes used in your test cases? If so, I think the simplest
solution would be to put them in src/test/java.

Test classes are not put in your final distribution/jars.

On 10/11/05, Allison, Bob [EMAIL PROTECTED] wrote:

 I would like to set things up in a project to compile a set of mock 
 objects stored in src/mock/java into target/mock-classes. These 
 classes should NOT be included into target/classes, since these 
 classes are not part of the distribution artifact. They need to be 
 assembled into a jar with a classifier of -mock for use in other
project's unit tests.

 I am looking at two possible ways of doing this:

 1) Write a plugin which extends AbstractCompilerMojo. If I do this, I 
 guess I need to add the compiler plugin as a dependency. I also need 
 to figure out how to populate the List and Set parameter objects 
 (source roots, classpath, includes, excludes) in the plugin 
 configuration element.

 2) Add some information to the compiler plugin configuration to add a 
 second execution. To do this, I need to figure out how to specify new 
 values for the expressions such as ${project.compileSourceRoots} 
 since the actual plugin parameters are read only.

 Does anybody have any suggestions on how to do either of these options 
 or perhaps another option to consider?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]