[Fwd: Re: How to pass different options to javac during compile and testCompile goals?]

2007-11-22 Thread Sahoo

Any help?

Thanks,
Sahoo
---BeginMessage---

Hi Milos,

Milos Kleint wrote:

Sahoo wrote:
(Resending as I am on the users alias now. I have also put a 
reference to a similar unsolved question from the past)


Hi,

I want to pass different options to maven-compiler-plugin during compile
and testCompile goals. Let's say, I want to set source level as 1.4 for
all my src/main/java code and set source level as 1.5 for my test
sources. How do I do it? I found someone having similar requirements 
in the past [1], but there is no mention of a working solution yet.


Thanks,
Sahoo

[1] 
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL PROTECTED] 






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


what about something like this?

build
  plugins
  plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-compiler
-plugin/artifactId
  configuration
 
compilerVersion${sourceLevel}/compilerVersion

  source${sourceLevel}/source
  target${sourceLevel}/target
  /configuration
  executions
  execution
  idcompile-tests/id
  phaseprocess-test-sources/phase
  goals
  goaltestCompile/goal
  /goals
  configuration
 
source${testSourceLevel}/source
 
target${testSourceLevel}/target

  /configuration
  /execution
  /executions
  /plugin
  /plugins
/build
properties
  sourceLevel1.4/sourceLevel
  testSourceLevel1.5/testSourceLevel
/properties

Regards

Milos Kleint


Thanks for your timely response. Your suggestion seems to work, but I 
think there is something else which is contributing to the success here. 
*I see maven-compiler-plugin:testCompile goal is invoked twice*. The 
first time it uses our execution configuration, where as the second time 
around, it uses the default configuration. Since the test sources are 
already compiled during first execution, they are not compiled second 
time around. See the output below:


[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /tmp/my-app/target/classes
[INFO] [compiler:testCompile {execution: compile-tests}]
[INFO] Compiling 1 source file to /tmp/my-app/target/test-classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]

Thanks,
Sahoo


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

Re: How to pass different options to javac during compile and testCompile goals?

2007-11-21 Thread Sahoo

Hi Milos,

Milos Kleint wrote:

Sahoo wrote:
(Resending as I am on the users alias now. I have also put a 
reference to a similar unsolved question from the past)


Hi,

I want to pass different options to maven-compiler-plugin during compile
and testCompile goals. Let's say, I want to set source level as 1.4 for
all my src/main/java code and set source level as 1.5 for my test
sources. How do I do it? I found someone having similar requirements 
in the past [1], but there is no mention of a working solution yet.


Thanks,
Sahoo

[1] 
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL PROTECTED] 






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


what about something like this?

build
  plugins
  plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-compiler
-plugin/artifactId
  configuration
 
compilerVersion${sourceLevel}/compilerVersion

  source${sourceLevel}/source
  target${sourceLevel}/target
  /configuration
  executions
  execution
  idcompile-tests/id
  phaseprocess-test-sources/phase
  goals
  goaltestCompile/goal
  /goals
  configuration
 
source${testSourceLevel}/source
 
target${testSourceLevel}/target

  /configuration
  /execution
  /executions
  /plugin
  /plugins
/build
properties
  sourceLevel1.4/sourceLevel
  testSourceLevel1.5/testSourceLevel
/properties

Regards

Milos Kleint


Thanks for your timely response. Your suggestion seems to work, but I 
think there is something else which is contributing to the success here. 
*I see maven-compiler-plugin:testCompile goal is invoked twice*. The 
first time it uses our execution configuration, where as the second time 
around, it uses the default configuration. Since the test sources are 
already compiled during first execution, they are not compiled second 
time around. See the output below:


[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /tmp/my-app/target/classes
[INFO] [compiler:testCompile {execution: compile-tests}]
[INFO] Compiling 1 source file to /tmp/my-app/target/test-classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]

Thanks,
Sahoo

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



How to pass different options to javac during compile and testCompile goals?

2007-11-20 Thread Sahoo
(Resending as I am on the users alias now. I have also put a reference 
to a similar unsolved question from the past)


Hi,

I want to pass different options to maven-compiler-plugin during compile
and testCompile goals. Let's say, I want to set source level as 1.4 for
all my src/main/java code and set source level as 1.5 for my test
sources. How do I do it? I found someone having similar requirements in 
the past [1], but there is no mention of a working solution yet.


Thanks,
Sahoo

[1] 
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL PROTECTED]





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



Re: How to pass different options to javac during compile and testCompile goals?

2007-11-20 Thread Milos Kleint

Sahoo wrote:
(Resending as I am on the users alias now. I have also put a reference 
to a similar unsolved question from the past)


Hi,

I want to pass different options to maven-compiler-plugin during compile
and testCompile goals. Let's say, I want to set source level as 1.4 for
all my src/main/java code and set source level as 1.5 for my test
sources. How do I do it? I found someone having similar requirements 
in the past [1], but there is no mention of a working solution yet.


Thanks,
Sahoo

[1] 
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL PROTECTED] 






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


what about something like this?

build
  plugins
  plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-compiler
-plugin/artifactId
  configuration
 
compilerVersion${sourceLevel}/compilerVersion

  source${sourceLevel}/source
  target${sourceLevel}/target
  /configuration
  executions
  execution
  idcompile-tests/id
  phaseprocess-test-sources/phase
  goals
  goaltestCompile/goal
  /goals
  configuration
 
source${testSourceLevel}/source
 
target${testSourceLevel}/target

  /configuration
  /execution
  /executions
  /plugin
  /plugins
/build
properties
  sourceLevel1.4/sourceLevel
  testSourceLevel1.5/testSourceLevel
/properties

Regards

Milos Kleint


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



How to pass different options to javac during compile and testCompile goals?

2007-11-20 Thread Sahoo
(I have not yet subscribed to users alias, so please copy a reply 
directly to me)


Hi,

I want to pass different options to maven-compiler-plugin during compile 
and testCompile goals. Let's say, I want to set source level as 1.4 for 
all my src/main/java code and set source level as 1.5 for my test 
sources. How do I do it?


Thanks,
Sahoo



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