Skip to content

Commit a594d85

Browse files
committed
[MNG-8286] Add a condition profile based on a simple expressions
1 parent ef9aea6 commit a594d85

File tree

14 files changed

+2200
-4
lines changed

14 files changed

+2200
-4
lines changed

api/maven-api-model/src/main/mdo/maven.mdo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,6 +2802,12 @@
28022802
<type>String</type>
28032803
<description>Specifies that this profile will be activated based on the project's packaging.</description>
28042804
</field>
2805+
<field>
2806+
<name>condition</name>
2807+
<version>4.1.0+</version>
2808+
<type>String</type>
2809+
<description>The condition which must be satisfied to activate the profile.</description>
2810+
</field>
28052811
<!--
28062812
This could be included once we teach Maven to deal with multiple versions of the model
28072813
<field>

api/maven-api-settings/src/main/mdo/settings.mdo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,14 @@
744744
Specifies that this profile will be activated based on the project's packaging.
745745
</description>
746746
</field>
747+
<field>
748+
<name>condition</name>
749+
<version>2.0.0+</version>
750+
<type>String</type>
751+
<description>
752+
The condition which must be satisfied to activate the profile.
753+
</description>
754+
</field>
747755
</fields>
748756
</class>
749757

maven-api-impl/src/main/java/org/apache/maven/internal/impl/SettingsUtilsV4.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public static Profile convertToSettingsProfile(org.apache.maven.api.model.Profil
127127

128128
activation.packaging(modelActivation.getPackaging());
129129

130+
activation.condition(modelActivation.getCondition());
131+
130132
profile.activation(activation.build());
131133
}
132134

@@ -212,6 +214,8 @@ public static org.apache.maven.api.model.Profile convertFromSettingsProfile(Prof
212214

213215
activation.packaging(settingsActivation.getPackaging());
214216

217+
activation.condition(settingsActivation.getCondition());
218+
215219
profile.activation(activation.build());
216220
}
217221

0 commit comments

Comments
 (0)