You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Howard Lewis Ship <hl...@gmail.com> on 2005/11/15 01:58:26 UTC

Configure compile JDK vs. compile-test JDK

I would like to compile my code as source and target for JDK 1.3.

However, I use some JDK 1.5 stuff in my tests; I would like to
configure my tests differently.

Looking at the configuration mechanism, it appears that the
granularity is at the plugin level.  I can't see how to configure one
goal within a plugin differently than another.

I've been looking over the docs, including
http://maven.apache.org/plugins/maven-compiler-plugin/howto.html, and
not seeing how to set things one way for compiler:compile, and another
way for compiler:testCompile.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Configure compile JDK vs. compile-test JDK

Posted by Brett Porter <br...@gmail.com>.
We seem to have missed that use case after we changed from the
per-goal configuration model to the lifecycle bindings.

I think our medium term plan is to make the compiler configuration a
separate component referenced from that plugin, and then the test one
can have its own configuration, but defaults to the normal compile
configuration. I'll get it into JIRA as two separate items.

As a stopgap, I think the following will work as is even if a bit verbose:
<configuration>
  <skip>true</skip>
  <source>1.3</source>
  <target>1.3</target>
</configuration>
<executions>
  <execution>
    <configuration>
      <skip>false</skip>
      <source>1.5</source>
      <target>1.5</target>
    </configuration>
    <goals>
      <goal>test-compile</goal>
    </goals>
  </execution>
</executions>

what this does:
- configure the compiler plugin for 1.3, and skip the default test compile goal
- add an additional test compile goal with the new parameters and the
test compilation not skipped

Cheers,
Brett

On 11/15/05, Howard Lewis Ship <hl...@gmail.com> wrote:
> I would like to compile my code as source and target for JDK 1.3.
>
> However, I use some JDK 1.5 stuff in my tests; I would like to
> configure my tests differently.
>
> Looking at the configuration mechanism, it appears that the
> granularity is at the plugin level.  I can't see how to configure one
> goal within a plugin differently than another.
>
> I've been looking over the docs, including
> http://maven.apache.org/plugins/maven-compiler-plugin/howto.html, and
> not seeing how to set things one way for compiler:compile, and another
> way for compiler:testCompile.
>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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