SoftwareEntwicklung Beratung Schulung

A coders, hackers heaven.....Hm...I do not think so...

Iterator Maven Plugin Version 0.3 Released

| Comments

Hi to all,

i have released a new version of the Iterator Maven Plugin which can iterate over items.

  • The goal executor has been renamed to iterator which is more releated to the things its doing.

  • Added some documentation for the folder support which can be used to iterate over a directory which contains one or more folders.

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:

Iterator Maven Plugin Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<plugin>
  <groupId>com.soebes.maven.plugins</groupId>
  <artifactId>iterator-maven-plugin</artifactId>
  <version>0.3</version>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>iterator</goal>
      </goals>
      <configuration>
        <items>
          <item>test</item>
          <item>prod</item>
          <item>dev</item>
        </items>

        <pluginExecutors>
          <pluginExecutor>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-assembly-plugin</artifactId>
              <version>2.4</version>
            </plugin>
            <goal>single</goal>
            <configuration>
              <descriptors>
                <descriptor>${project.basedir}/@item@.xml</descriptor>
              </descriptors>
            </configuration>
          </pluginExecutor>
        </pluginExecutors>
      </configuration>
    </execution>
  </executions>
</plugin>

The following example shows how the new feature for folder iteration can be used. The real usage is only limited by your own imagination.

Iterator Maven Plugin Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<plugin>
  <groupId>com.soebes.maven.plugins</groupId>
  <artifactId>iterator-maven-plugin</artifactId>
  <version>0.3</version>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>iterator</goal>
      </goals>
      <configuration>
        <folder>src/main/java/com/soebes/maven/multiple/</folder>
        <pluginExecutors>
          <pluginExecutor>
            <plugin>
              <groupId>com.soebes.maven.plugins</groupId>
              <artifactId>maven-echo-plugin</artifactId>
            </plugin>
            <goal>echo</goal>
            <configuration>
              <echos>
                <echo>This is a message: @item@</echo>
              </echos>
            </configuration>
          </pluginExecutor>
        </pluginExecutors>
      </configuration>
    </execution>
  </executions>
</plugin>

Comments