You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Timo Wolf <wo...@in.tum.de> on 2007/01/16 09:06:41 UTC
Platform depending compilation
Hi All,
I have a java swing application that I build with maven. I include
some Mac OS X java libraries to integrate the app into OS X. I get
errors when compiling on Windows, as the os x libraries are not
available.
Is it possible to detect the current OS and exclude some java classes
from compiling when not working on OS X?
I am looking to configure the compile like:
<if>
<equals arg1="${isMacOsX}" arg2="false" />
<then>
<exclude>myClassesToExclude</exclude>
</then>
</if>
thanks a lot
Timo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Platform depending compilation
Posted by Martin Gilday <ma...@imap.cc>.
Not automated but the simplest way would be to define a profile for OSX.
Then in the standard definition set the compiler plugin to exclude[1]
the classes. Then in the OSX profile override the compiler plugin to
remove the exclude.
Then you would just need to either do mvn compile or mvn -Posx compile.
Not sure of how to automate to profile selection though.
[1]http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#excludes
----- Original message -----
From: "Timo Wolf" <wo...@in.tum.de>
To: "Maven Users List" <us...@maven.apache.org>
Date: Tue, 16 Jan 2007 09:06:41 +0100
Subject: Platform depending compilation
Hi All,
I have a java swing application that I build with maven. I include
some Mac OS X java libraries to integrate the app into OS X. I get
errors when compiling on Windows, as the os x libraries are not
available.
Is it possible to detect the current OS and exclude some java classes
from compiling when not working on OS X?
I am looking to configure the compile like:
<if>
<equals arg1="${isMacOsX}" arg2="false" />
<then>
<exclude>myClassesToExclude</exclude>
</then>
</if>
thanks a lot
Timo
---------------------------------------------------------------------
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