Iterator Maven Plugin Version 0.4 Released
Hi to all,
i have released a new version of the Iterator Maven Plugin which can iterate over items.
The release notes can be found here.
-
pluginManagement defined configuration can now being used.
-
Added new itemsWithProperties to support supplemental properties for each iteration element.
-
Added skip option.
-
Added failAtEnd option.
Apart from that many technical aspects have been improved but which are not noteworthy for the users of this plugin. Anyone who is interested in such details just take a look into the git history of the project.
Furthermore if you find bugs, having ideas for improvements etc. do not hesitate to contact me via Github Issue tracking system.
The iterator-maven-plugin is available via Maven Central.
Here is an example how you can use the iterator-maven-plugin:
1<plugin>
2 <groupId>com.soebes.maven.plugins</groupId>
3 <artifactId>iterator-maven-plugin</artifactId>
4 <version>0.4</version>
5 <executions>
6 <execution>
7 <phase>package</phase>
8 <goals>
9 <goal>iterator</goal>
10 </goals>
11 <configuration>
12 <items>
13 <item>test</item>
14 <item>prod</item>
15 <item>dev</item>
16 </items>
17
18 <pluginExecutors>
19 <pluginExecutor>
20 <plugin>
21 <groupId>org.apache.maven.plugins</groupId>
22 <artifactId>maven-assembly-plugin</artifactId>
23 <version>2.5.2.</version>
24 </plugin>
25 <goal>single</goal>
26 <configuration>
27 <descriptors>
28 <descriptor>${project.basedir}/@item@.xml</descriptor>
29 </descriptors>
30 </configuration>
31 </pluginExecutor>
32 </pluginExecutors>
33 </configuration>
34 </execution>
35 </executions>
36</plugin>
The following example shows how the new feature for itemsWithProperties can be used. This means that for every iteration not only the value of the iteration is given as property also the supplemental defined properties are injected into the properties of the project which can of course being accessed via usualy way in Maven. The real usage is only limited by your own imagination.
1<plugin>
2 <groupId>com.soebes.maven.plugins</groupId>
3 <artifactId>iterator-maven-plugin</artifactId>
4 <version>0.4</version>
5 <executions>
6 <execution>
7 <phase>package</phase>
8 <goals>
9 <goal>iterator</goal>
10 </goals>
11 <configuration>
12 <itemsWithProperties>
13 <itemsWithProperty>
14 <name>test</name>
15 <properties>
16 <key>value1</key>
17 </properties>
18 </itemsWithProperty>
19 <itemsWithProperty>
20 <name>prod</name>
21 <properties>
22 <key>value2</key>
23 </properties>
24 </itemsWithProperty>
25 <itemsWithProperty>
26 <name>dev</name>
27 <properties>
28 <key>value3</key>
29 </properties>
30 </itemsWithProperty>
31 </itemsWithProperties>
32
33 <pluginExecutors>
34 <pluginExecutor>
35 ...
36 </pluginExecutor>
37 </pluginExecutors>
38 </configuration>
39 </execution>
40 </executions>
41</plugin>