You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/06/07 07:51:00 UTC

[2/2] git commit: [flex-falcon] [refs/heads/develop] - - Added an enforcer rule to check if one of the profiles 'utils', 'compiler' or 'externs' is selected.

- Added an enforcer rule to check if one of the profiles 'utils', 'compiler' or 'externs' is selected.


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/53bb66c8
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/53bb66c8
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/53bb66c8

Branch: refs/heads/develop
Commit: 53bb66c8385a9d5ef6b76ec38ffc1878b0db0e0a
Parents: 2e4d1cc
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Tue Jun 7 09:50:52 2016 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Tue Jun 7 09:50:52 2016 +0200

----------------------------------------------------------------------
 pom.xml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/53bb66c8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6b59500..c52dae7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -144,6 +144,9 @@
     <profiles>
         <profile>
             <id>utils</id>
+            <properties>
+                <active-profile>utils</active-profile>
+            </properties>
             <modules>
                 <module>compiler-build-tools</module>
                 <module>compiler-jburg-types</module>
@@ -153,6 +156,9 @@
 
         <profile>
             <id>compiler</id>
+            <properties>
+                <active-profile>compiler</active-profile>
+            </properties>
             <modules>
                 <module>compiler</module>
                 <module>compiler-jx</module>
@@ -163,6 +169,9 @@
 
         <profile>
             <id>externs</id>
+            <properties>
+                <active-profile>externs</active-profile>
+            </properties>
             <modules>
                 <module>externs</module>
             </modules>
@@ -171,7 +180,7 @@
 
     <build>
         <plugins>
-            <!--plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.4.1</version>
@@ -183,16 +192,23 @@
                         </goals>
                         <configuration>
                             <rules>
-                                <requireActiveProfile>
-                                    <profiles>utils,compiler,externs</profiles>
-                                    <all>false</all>
-                                </requireActiveProfile>
+                                <!--
+                                    The profiles are only available if they are defined in the
+                                    current pom. So we would have to define all profiles in each
+                                    child pom. Using a property defined in the profiles makes this
+                                    property available in all children, so we use this to check
+                                    if a profile was selected.
+                                -->
+                                <requireProperty>
+                                    <property>active-profile</property>
+                                    <message>You must select one of the profiles 'utils', 'compiler' or 'externs' using the '-P{profilename}' commandline option</message>
+                                </requireProperty>
                             </rules>
                             <fail>true</fail>
                         </configuration>
                     </execution>
                 </executions>
-            </plugin-->
+            </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>