You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by emerson cargnin <ec...@gmail.com> on 2009/05/26 17:34:14 UTC

Setting the JDK via property

Hi

I need to set the jdk via command line, but having a way to use a default one.

In maven one I used:maven.compile.source and maven.compile.target property

In maven 2 I found at this page:
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgument

It tells:
source  The -source argument for the Java compiler.

    * Type: java.lang.String
    * Required: No
    * Expression: ${maven.compiler.source}

Does it mean that the maven.compiler.source can be used as a property
from the mvn command line?
I tried that , but it didn't work.

I know I can also set in the compiler plugin via

<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${my.property}</source>
					<target>${my.property}</target>
				</configuration>
			</plugin>
		</plugins>

But then I would need to force everyone to add the property?

emerson

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


Re: Setting the JDK via property

Posted by Anders Hammar <an...@hammar.net>.
Maybe you can use a profile in your pom to modify the
maven-compiler-plugin configuration?
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

/Anders

On Tue, May 26, 2009 at 17:34, emerson cargnin
<ec...@gmail.com> wrote:
> Hi
>
> I need to set the jdk via command line, but having a way to use a default one.
>
> In maven one I used:maven.compile.source and maven.compile.target property
>
> In maven 2 I found at this page:
> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgument
>
> It tells:
> source  The -source argument for the Java compiler.
>
>    * Type: java.lang.String
>    * Required: No
>    * Expression: ${maven.compiler.source}
>
> Does it mean that the maven.compiler.source can be used as a property
> from the mvn command line?
> I tried that , but it didn't work.
>
> I know I can also set in the compiler plugin via
>
> <plugins>
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>                                <artifactId>maven-compiler-plugin</artifactId>
>                                <configuration>
>                                        <source>${my.property}</source>
>                                        <target>${my.property}</target>
>                                </configuration>
>                        </plugin>
>                </plugins>
>
> But then I would need to force everyone to add the property?
>
> emerson
>
> ---------------------------------------------------------------------
> 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