Hi Joachim,

Joachim Van der Auwera wrote:

> On 02/01/2011 11:03 PM, Jörg Schaible wrote:
>> Hi Joachim,
>>
>> Joachim Van der Auwera wrote:
>>
>>> On 02/01/2011 10:55 AM, Jörg Schaible wrote:
>>>> Joachim Van der Auwera wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have a build for a GWT module. This includes the GWT plug-in for
>>>>> compilation (which is slow) and selenium integration tests (slow
>>>>> again).
>>>>>
>>>>> Some of the developers use m2eclipse for development, so we have
>>>>> configured the GWT compilation to be disabled when the m2e.version
>>>>> property is set (this is the only way we have found to discover the
>>>>> use of m2eclipse).
>>>>>
>>>>> We would like to be able to disable either GWT compilation using
>>>>> -DskipGwt on the command line and/or disable selenium tests to be run
>>>>> using -DskipSelenium.
>>>>>
>>>>> Our pom currently contains the following profile configuration
>>>>> (excluding profile details):
>>>> Activation is only supported for system properties, project properties
>>>> (i.e. properties defined in a POM) cannot be supported. Profile
>>>> evaluation happens before any project evaluation (it has to).
>>> Thanks for the info.
>>> Do you think it makes sense to implement allowing expressions like
>>> "!skipGWT&&  !m2e.version" for activation of a profile?
>> Could have been handy already. However, my typical approach is currently
>> to define as many properties as possible within the profile that triggers
>> the build behavior.
>>
>> If e.g. the gwt plugin has a skip execution, then invent a property on
>> your own (e.g. mycompany.skip.gwt) and set it by default to true. Add the
>> skipExecution element to the configuration and set the value using this
>> property. In such a case it does not really matter if the profile
>> activated by !skipGWT and the one activated by !m2e.version define the
>> value of this property as true individually.
> 
> Does that not mean that the plugins which are to be enabled/disabled
> each need a property to enable or disable that plugin?

Yes. Fortunately a lot have (incl. GWT plugin, see 
http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html#skip).

> Otherwise I don't
> really understand. Could you point me to a pom where this approach is
> used?

Our poms are inhouse, but the essential part is something like:


 <build>
   <plugins>
     <artifactId>gwt-maven-plugin>
     <configuration>
       <skip>${mycompany.skip}</skip>
     </configuration>
   </plugins>
 </build>
 <properties>
   <mycompany.skip>false</mycompany.skip>
 </properties>
 <profiles>
   <profile>
     <id>A</id>
     <properties>
       <mycompany.skip>true</mycompany.skip>
     </properties>
   </profile>
   <profile>
     <id>B</id>
     <properties>
       <mycompany.skip>true</mycompany.skip>
     </properties>
   </profile>
 </profiles>


> Thanks for much for your help.

You're welcome,
Jörg



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

Reply via email to