Code Monkey home page Code Monkey logo

iterator-maven-plugin's Introduction

Iterator Maven Plugin

Build Status Maven Central Apache License, Version 2.0, January 2004

Build Status

Overview

The iterator-maven-plugin is intended to make iterations on a list possible. This means to execute other plugins or Maven itself based on the iteratation of the given elements.

This is in the majority of the cases based on wrong decoupling the configuration from the artifacts (like webapp, ear etc.).

Homepage

http://khmarbaise.github.com/iterator-maven-plugin/

Description

It might be helpful to create a plugin which is able to call a plugin on iterating through some kind of data.

For example:

The following possible solutions exist:

<build>
  <plugins>
    <plugin>
      <groupId>com.soebes.maven.plugins</groupId>
      <artifactId>iterator-maven-plugin</artifactId>
      <version>0.5.0</version>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>iterator</goal>
          </goals>
          <configuration>
            <items>
              <item>one</item>
              <item>two</item>
              <item>three</item>
            </items>
            <pluginExecutors>
              <pluginExecutor>
                <plugin>
                  <groupId>com.soebes.maven.plugins</groupId>
                  <artifactId>echo-maven-plugin</artifactId>
                  <version>0.3</version>
                </plugin>
                <goal>echo</goal>
                <configuration>
                  <echos>
                    <echo>This is a message: @item@</echo>
                  </echos>
                </configuration>
              </pluginExecutor>
            </pluginExecutors>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

The result of the above configuration is that the maven-echo-plugin will be called three times like the following:

[INFO] 
[INFO] --- iterator-maven-plugin:0.5.0:iterator (default) @ basic-test ---
[INFO]  ------ (one) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo
[INFO] This is a message: one
[INFO]  ------ (two) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo
[INFO] This is a message: two
[INFO]  ------ (three) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo
[INFO] This is a message: three
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

The result of the above can of course be achieved by using an appropriate number of execution blocks, but it will become cumbersome in particular if you have a larger number of executions (for example 10 or more).

An other example how the iterator-maven-plugin can make your life easier will be shown here:

  <plugin>
    <groupId>com.soebes.maven.plugins</groupId>
    <artifactId>iterator-maven-plugin</artifactId>
    <version>0.5.0</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}/@[email protected]</descriptor>
                </descriptors>
              </configuration>
            </pluginExecutor>
          </pluginExecutors>
        </configuration>
      </execution>
    </executions>
  </plugin>

In the above example the iteration variable @item@ is used to access the different assembly descriptor files in the project base directory.

It is also possible to iterator over a list of folders which means you can configure iterator-maven-plugin like the following:

  <plugin>
    <groupId>com.soebes.maven.plugins</groupId>
    <artifactId>iterator-maven-plugin</artifactId>
    <version>0.5.0</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>
            <pluginExecutor>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
              </plugin>
              <goal>jar</goal>
              <configuration>
                <includes>
                  <include>com/soebes/maven/multiple/@item@/**</include>
                </includes>
                <classifier>@item@</classifier>
              </configuration>
            </pluginExecutor>
          </pluginExecutors>
        </configuration>
      </execution>
    </executions>
  </plugin>

You can see what is possible, but i can not recommend to do things like this in particular calling the maven-jar-plugin like this.

Having a property which contains a list of servers like this:

list_of_servers=host1, host2, host3

for (server : list_of_servers) {
  call mvn -D$server
}

for (server : list_of_servers) {
  call mvn -Dgoal=$server
}

for (server : list_of_servers) {
  call $server/mvn -Dserver=$server clean package
}



  <plugin>
    <groupId>com.soebes.maven.plugins</groupId>
    <artifactId>iterator-maven-plugin</artifactId>
    <version>0.5.0</version>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>invoker</goal>
        </goals>
        <configuration>
          <items>
            <item>test</item>
            <item>prod</item>
            <item>dev</item>
          </items>

          <mavenGoals>
            <mavenGoal>clean</mavenGoal>
            <mavenGoal>package</mavenGoal>
          </mavenGoals>
          <mavenBaseDir></mavenBaseDir>
          <pomFile>${project.basedir}/maven-calls/@item@/pom.xml</pomFile>
          <properties>
            <goal>@item@</goal>
          </properties>
        </configuration>
      </execution>
    </executions>
  </plugin>


  cd maven-calls/@item@/
  mvn -Dgoal=@item@ -f pom.xml clean package



<configuration>
  <servers>host1,host2,host3</servers>
  <separator>,</separator> <!-- RegEx? -->
  ..
</configuration>


<configuration>
  <content>s1,s2,s3,s4</content>

  <plugins>
    <plugin>
      <groupId>...</groupId>
      <artifactId>..</artifactId>
      <version>..</version>
      <configuration>
       ..Whatever configuration Replacement @value@
      </configuration>
    </plugin>
  </plugins>
</configuration>

Idea to use key/value pairs. key1, value11, value12, value13 key2, value21, value22, value23

First iteration:

@item.value.0@ => value11
@item.value.1@ => value12



@item.key@ => key1

Note

Starting with version 0.3 of iterator-maven-plugin the goal executor has been renamed to iterator cause it represents better the meaning.

Status

TODOs

Usage

see homepage.

iterator-maven-plugin's People

Contributors

dominikschlosser avatar khmarbaise avatar kinow avatar tunaki avatar vazexqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iterator-maven-plugin's Issues

How to pass system properties from command line to invoker

Hi,

I'm trying to pass system properties from command line with -D to the iterator:invoker. Unfortunately those values are not present during the iteration.

> mvn package -Pinvoker -Dzzz="hello world" -Denvironment=local
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building invoker-with-system-properties 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (echo-properties) @ test-invoker-with-system-properties ---
[INFO] Executing tasks

main:
     [echo] environment: local
     [echo] profile-name: ${profile-name}
     [echo] zzz: hello world
[INFO] Executed tasks
[INFO]
[INFO] --- iterator-maven-plugin:0.5.0:invoker (invoke-with-system-properties) @ test-invoker-with-system-properties ---
[INFO] ------  iterator-maven-plugin ( iteration: foo )
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building invoker-with-system-properties 1.0-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-antrun-plugin:1.8:run (echo-properties) @ test-invoker-with-system-properties ---
[INFO] [INFO] Executing tasks
[INFO]
[INFO] main:
[INFO]      [echo] environment: ${environment}
[INFO]      [echo] profile-name: foo
[INFO]      [echo] zzz: bye, bye
[INFO] [INFO] Executed tasks
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 0.518 s
[INFO] [INFO] Finished at: 2017-07-28T16:03:08+02:00
[INFO] [INFO] Final Memory: 5M/15M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ------ Maven call was Ok.
[INFO] ------  iterator-maven-plugin ( iteration: bar )
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building invoker-with-system-properties 1.0-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-antrun-plugin:1.8:run (echo-properties) @ test-invoker-with-system-properties ---
[INFO] [INFO] Executing tasks
[INFO]
[INFO] main:
[INFO]      [echo] environment: ${environment}
[INFO]      [echo] profile-name: bar
[INFO]      [echo] zzz: bye, bye
[INFO] [INFO] Executed tasks
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 0.521 s
[INFO] [INFO] Finished at: 2017-07-28T16:03:10+02:00
[INFO] [INFO] Final Memory: 5M/15M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ------ Maven call was Ok.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.032 s
[INFO] Finished at: 2017-07-28T16:03:10+02:00
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

I would expect, that the property ${environment} is always printed with the passed value local, as well as the property ${zzz} printed with the passed value hello world.

Do I miss something?

Please find attached the according pom.
pom.xml.txt

How to access item name as property

There should be an example on how to access the value given in either

  • items->item
  • itemsWithProperties->itemWithProperty->name or
  • content (the current value of the comma-separated list)

as a property from the downstream project (if you use goal invoker). Also it is not completely clear from the documentation where placeholders like @item@ are getting replaced (I guess only within the plugin configuration of this plugin).

Plugin-Dependencies from the iterator-goal are not available in the pluginExecutor

Hey Karl-Heinz,

the plugin dependencies from the iterator-goal are not available in the pluginExecutor child plugins. If the plugin, which should be iterated, needs a plugin dependency it is not possible to set this dependency. The plugin dependencies of the iterator-goal itself are not passed:

<plugin>
   <groupId>com.soebes.maven.plugins</groupId>
   <artifactId>iterator-maven-plugin</artifactId>
   <version>0.4-SNAPSHOT</version>
   <executions>
        <execution>
            <id>invoke-integration-test-goals</id>
            <goals>
                <goal>iterator</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
                <pluginExecutors>
                    <pluginExecutor>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>sql-maven-plugin</artifactId>
                            <version>1.5</version>
                        </plugin>
                        <goal>execute</goal>
                        <configuration>
                            <sqlCommand>DROP DATABASE ${db-name}</sqlCommand>
                            <skip>${skip-integration-tests}</skip>
                            <driver>org.postgresql.Driver</driver>
                            <url>${db.schema.for.drop}</url>
                            <username>${db-username}</username>
                            <password>${db-password}</password>
                            <autocommit>true</autocommit>
                        </configuration>
                    </pluginExecutor>
                <pluginExecutors>
            </configuration>
        </execution>
    <executions>
    <dependencies>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.4-1201-jdbc4</version>
        </dependency>
    </dependencies>
<plugin>

So this would produce the error:

[...]
[INFO] ------ (ITEM1) org.codehaus.mojo:sql-maven-plugin:1.5:execute
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.651 s
[INFO] Finished at: 2016-04-30T03:24:04+02:00
[INFO] Final Memory: 19M/305M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.4-SNAPSHOT:iterator (invoke-integration-test-goals) on project test-app: Driver class not found: org.postgresql.Driver -> [Help 1]
[...]

Could you fix this?

Thanks,
Oilid

Fixing the problem during the release:perform goal

[INFO] Building index for all the packages and classes...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/overview-tree.html...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/index-all.html...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/deprecated-list.html...
[INFO] Building index for all classes...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/allclasses-frame.html...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/allclasses-noframe.html...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/index.html...
[INFO] Generating /home/kama/ws-git/itexin-maven-plugin/target/checkout/target/site/testapidocs/help-doc.html...
[INFO] [INFO]
[INFO] [INFO] --- site-maven-plugin:0.7:site (default) @ iterator-maven-plugin ---
[INFO] [INFO] Creating 98 blobs
[INFO] [INFO] Creating tree with 98 blob entries
[INFO] [INFO] Creating commit with SHA-1: 0175f2b
[INFO] [INFO] Updating reference refs/heads/gh-pages from 9cdd47e to 0175f2b
[INFO] [INFO]
[INFO] [INFO] --- maven-site-plugin:3.2:deploy (default-deploy) @ iterator-maven-plugin ---
[INFO] [INFO] Parent project loaded from repository: com.soebes.smpp:smpp:pom:0.6
[INFO] [INFO] Parent project loaded from repository: com.soebes.smpp:smpp:pom:0.6
[INFO] scp://minden205.server4you.de:/usr/local/vhosts/site.supose.org/com.soebes.smpp/smpp/0.6/ - Session: Connection refused
[INFO] scp://minden205.server4you.de:/usr/local/vhosts/site.supose.org/com.soebes.smpp/smpp/0.6/ - Session: Disconnecting
[INFO] scp://minden205.server4you.de:/usr/local/vhosts/site.supose.org/com.soebes.smpp/smpp/0.6/ - Session: Disconnected
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 6:20.575s
[INFO] [INFO] Finished at: Sat Mar 30 11:13:15 CET 2013
[INFO] [INFO] Final Memory: 47M/353M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.2:deploy (default-deploy) on project iterator-maven-plugin: Error uploading site: Private key '/Users/km/keys/rsa-minden205.server4you.de.ppk' not found -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:39.298s
[INFO] Finished at: Sat Mar 30 11:13:16 CET 2013
[INFO] Final Memory: 10M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4:perform (default-cli) on project iterator-maven-plugin: Maven execution failed, exit code: '1' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
kama@office:~/ws-git/itexin-maven-plugin$

Clarify reasoning of "Bad Citizen"

Specifically, what makes a user of this plugin a bad citizen of the maven ecosystem? The plugin solved a specific problem I had where a toolset relied on abilities in Ant not present in Maven.

Usage in Maven Antrun Plugin

I've got several computers and I want to execute certain commands for each of them:

  • Stop pasada service.
  • Copy through SCP the new version of asada into the computer.
  • Start pasada service.

To do so, I'm using maven-antrun-plugin, which looks like the following code:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>scp-to-remote</id>
            <phase>package</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <target>
                    <sshexec trust="true" failonerror="true"
                        host="asa2071.dyndns.org"
                        username="pi" 
                        password="mypass"
                        command="sudo systemctl stop pasada"
                        timeout="120000" />	
                    <scp 
                        localFile="${project.basedir}/target/pasada-2.0.0.RELEASE.jar"
                        remoteToFile="[email protected]:/home/pi/asada/pasada/pasada.jar" verbose="true"
                        password="mypass" trust="true">
                    </scp>
                    <sshexec trust="true" failonerror="true"
                        host="asa2071.dyndns.org"
                        username="pi"
                        password="mypass"
                        command="sudo systemctl start pasada"
                        timeout="120000" />	
                </target>
            </configuration>
        </execution>
    </executions>
    <!-- libraries for scp impl -->
    <!-- antrun doesn't use os's scp -->
    <dependencies>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.53</version>
        </dependency>
        <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-jsch</artifactId>
            <version>1.6.5</version>
        </dependency>
    </dependencies>
</plugin>

The previous code is working well when invoking mvn package.

I've found your plugin and I'd like to integrate maven-antrun-plugin with it. So far, I've written the following code:

<plugin>
    <groupId>com.soebes.maven.plugins</groupId>
    <artifactId>iterator-maven-plugin</artifactId>
    <version>0.5.1</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>iterator</goal>
            </goals>
            <configuration>
                <content>2071,2076</content>
                <pluginExecutors>
                    <pluginExecutor>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>scp-to-remote</id>
                                    <phase>package</phase>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                    <configuration>
                                        <target>
                                            <sshexec trust="true" failonerror="true"
                                                host="asa@[email protected]"
                                                username="pi" 
                                                password="mypass"
                                                command="sudo systemctl stop pasada"
                                                timeout="120000" />	
                                            <scp 
                                                localFile="${project.basedir}/target/pasada-2.0.0.RELEASE.jar"
                                                remoteToFile="pi@asa@[email protected]:/home/pi/asada/pasada/pasada.jar" verbose="true"
                                                password="mypass" trust="true">
                                            </scp>
                                            <sshexec trust="true" failonerror="true"
                                                host="asa@[email protected]"
                                                username="pi"
                                                password="mypass"
                                                command="sudo systemctl start pasada"
                                                timeout="120000" />	
                                        </target>
                                    </configuration>
                                </execution>
                            </executions>
                            <dependencies>
                                <dependency>
                                    <groupId>com.jcraft</groupId>
                                    <artifactId>jsch</artifactId>
                                    <version>0.1.53</version>
                                </dependency>
                                <dependency>
                                    <groupId>ant</groupId>
                                    <artifactId>ant-jsch</artifactId>
                                    <version>1.6.5</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                    </pluginExecutor>
                </pluginExecutors>
            </configuration>
        </execution>
    </executions>
</plugin>

However, when running mvn package I get the following message:

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.ingartek.efimat:canbus-receiver >-----------------
[INFO] Building canbus-receiver 2.0.0.RELEASE
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for net.sourceforge.jFuzzyLogic:jFuzzyLogic:jar:2.0.7 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ canbus-receiver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ canbus-receiver ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 61 source files to D:\workspaces\workspace-efimat\canbus-receiver\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ canbus-receiver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspaces\workspace-efimat\canbus-receiver\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ canbus-receiver ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ canbus-receiver ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.ingartek.efimat.canbus_receiver.AppTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.057 s - in com.ingartek.efimat.canbus_receiver.AppTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ canbus-receiver ---
[INFO] Building jar: D:\workspaces\workspace-efimat\canbus-receiver\target\canbus-receiver-2.0.0.RELEASE.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) @ canbus-receiver ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- iterator-maven-plugin:0.5.1:iterator (default) @ canbus-receiver ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.382 s
[INFO] Finished at: 2019-03-12T15:59:29+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.5.1:iterator (default) on project canbus-receiver: Unable to parse configuration of mojo com.soebes.maven.plugins:iterator-maven-plugin:0.5.1:iterator for parameter target: Cannot find 'target' in class java.lang.Object -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

I don't understand the error message.

Would it be possible to make it work?

Thank you so much.

PS: let me know whether you need the whole pom.xml.

Missing ItemsWithProperties properties should be set to "", not "null".

I am using the iterator mojo to cross-compile a resource in my project for multiple platforms:

                    ...
                    <goals>
                        <goal>iterator</goal>
                    </goals>
                    <configuration>
                        <iteratorName>platform</iteratorName>
                        <itemsWithProperties>
                            <itemWithProperties>
                                <name>amd64-linux</name>
                                <properties>
                                    <arch>amd64</arch>
                                    <flavor>linux</flavor>
                                </properties>
                            </itemWithProperties>
                            <itemWithProperties>
                                <name>amd64-windows</name>
                                <properties>
                                    <arch>amd64</arch>
                                    <flavor>windows</flavor>
                                    <ext>.exe</ext>
                         ...

It would be nice in the scenario above if the properties were interpolated in the way my issue ticket title suggests, so that my binaries ended up being named:

    somebinary-amd64-linux-version3.4
    somebinary-amd64-windows-version3.4.exe

But instead, the missing value is interpreted as the string "null":

    somebinary-amd64-linux-version3.4null
    somebinary-amd64-windows-version3.4.exe

Of course the simple workaround is to add to the configuration that should have no value, but it seems that the sensible default behavior is to map missing properties to the empty string...

maven-install-plugin and maven-deploy-plugin behave differently with the same configuration in iterator-maven-plugin

Hi,

I used iterator-maven-plugin for creating multiple jar files and multiple tar.gz files for different environments. Jar files is used in tar.gz files. My final products are tar.gz files and I don't want maven to install or deploy my created jar files. I learned that if I use the install-file and deploy-file goals, I can only install or deploy the files I choose. Maven-install-plugin and maven-deploy-plugin configurations nearly the same. Only difference between two plugin configuration is tag.

maven-install-plugin installs only tar.gz files into local repository. That is what I want.
maven-deploy-plugin deploys tar.gz files but also deploys jar files into remote repository.
Why two plugins behave different and how can I fix this stuation?

I used this plugin versions:

			<plugin>
				<groupId>com.soebes.maven.plugins</groupId>
				<artifactId>iterator-maven-plugin</artifactId>
				<version>0.5.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<version>2.4</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
			</plugin>

Here is releated part of my pom.xml:

		<plugin>
			<groupId>com.soebes.maven.plugins</groupId>
			<artifactId>iterator-maven-plugin</artifactId>
			<executions>
				<execution>
					<phase>generate-resources</phase>
					<goals>
						<goal>iterator</goal>
					</goals>
					<configuration>
						<folder>${project.basedir}/filters</folder>
						<pluginExecutors>
                                                                  .
                                                                  .
                                                                  .
                                                                  .
                                                                  .
                                                                  .
                                                                  .
                                                                  .
							<pluginExecutor>
								<plugin>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-install-plugin</artifactId>
								</plugin>
								<goal>install-file</goal>
								<configuration>
									<file>${project.build.directory}/${project.name}-@[email protected]</file>
									<artifactId>${project.artifactId}</artifactId>
									<groupId>${project.groupId}</groupId>
									<packaging>tar.gz</packaging>
									<version>${project.version}</version>
									<classifier>@item@</classifier>
								</configuration>
							</pluginExecutor>
							<pluginExecutor>
								<plugin>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-deploy-plugin</artifactId>
								</plugin>
								<goal>deploy-file</goal>
								<configuration>
                                                                         <url>http://repo.mkk.com.tr/artifactory/snapshots</url>
									<file>${project.build.directory}/${project.name}-@[email protected]</file>
									<artifactId>${project.artifactId}</artifactId>
									<groupId>${project.groupId}</groupId>
									<packaging>tar.gz</packaging>
									<version>${project.version}</version>
									<classifier>@item@</classifier>
								</configuration>
							</pluginExecutor>
						</pluginExecutors>
					</configuration>
				</execution>
			</executions>
		</plugin>

iterator plugin gets confused and merges multiple executions together

I have a configuration which invokes maven-resources-plugin:copy-resources and maven-dependency-plugin:copy-dependencies on 2 different plugins. I get error messages saying that parameters from the copy-resources execution are being passed to the copy-dependencies.

Is it supported to use iterator for executions of different plugins?

Possibility to fail the master build process if one of the invocations fail

Hey Karl-Heinz,

is there a possibility to fail the master build process if one of the child invocations fail?

Currently the master build-process is successful although on of the child invocations fails (in Version 0.3 and greater?!).

My pom.xml is:

[...]
<goals>
    <goal>invoker</goal>
</goals>
<phase>integration-test</phase>
<configuration>
    <goals>
        <goal>failsafe:integration-test@run-integration-tests -Dtest-kunde=@item@</goal>
        <goal>failsafe:verify@verify-integration-tests -Dtest-kunde=@item@</goal>
    </goals>
</configuration>
[...]

This produces the output:

[...]
[INFO] [INFO] --- maven-failsafe-plugin:2.19.1:verify (verify-integration-tests) @ test-app ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 03:20 min
[INFO] [INFO] Finished at: 2016-04-29T23:49:36+02:00
[INFO] [INFO] Final Memory: 361M/1694M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (verify-integration-tests) on project test-app: There are test failures.
[INFO] [ERROR] 
[INFO] [ERROR] Please refer to C:\temp\target\failsafe-reports for the individual test results.
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR] 
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR] 
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] Maven call was NOT Ok. (1)
[ERROR] No exception
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:26 min
[INFO] Finished at: 2016-04-29T23:49:38+02:00
[INFO] Final Memory: 14M/300M
[INFO] ------------------------------------------------------------------------

So the master build is success even if one of the goals fails.

It would be nice if there is for example a flag "forceBuildFailsIfGoalFails" which can control the behaviour optionally.
Wouldn't it be easy to implement in the InvokerMojo.mavenCall method for example:

if ( result.getExitCode() == 0 ) {
    getLog().info( "Maven call Ok." );
} else {
    [...]
    if (isForceBuildFailsIfGoalFails()) {
        throw new MavenInvocationException(result.getExecutionException().getMessage(), result.getExecutionException().getCause());
    }
}

And in the execute-method:

for ( String item : getItems() ) {
    try {
        getLog().info( "mvn " + item );
        mavenCall( item );
    } catch ( MavenInvocationException e ) {
        getLog().error( "Failure during maven call:", e );
        if (isForceBuildFailsIfGoalFails()) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
}

This problem/issue is the same for the iterator-goal...

Thanks,
Oilid

Add skip flag to invoker and iterator goal

Hey Karl-Heinz,

could you add a skip-flag to your invoker and iterator goals? This would be really helpful, if the execution should be skipped dependending on a profile property...

Currently we need to skip your goal executions if we don't want to run integration-tests on a "normal" build.

Thanks,
Oilid

inherit configuration for a pluginExecutor

In a project that is using the iterator-maven-plugin I have noticed that configuration for a plugin (which plugin is used by the iterator as a pluginExecutor), configuration that is defined in a pom.xml higher in the hierarchy (e.g. in the parent pom's pluginManagement section), does not get passed in the plugin execution spawned by the iterator plugin. Which means that said configuration needs to get duplicated for each instance of the plugin's usage by the iterator-maven-plugin.

Iterate over ... just one item

Hi,

I can't implement my use case with the plugin right now. My use case =>
I want to install my WebApp on multiple environnements, let say : dev, test, prod.
In test there are 2 Tomcat instances, prod 3 isntance, and just one in dev.

So I want my build to auto adjust the number of times I invoke the tomcat plugin to install my WAR file. My idea was to declare some properties in profiles.

So for 1 instance I want to set a property tomcatUrl
For 2 instances : tomcatUrl, tomcatUrl2
For n instances : tomcatUrl, tomcatUrl2, ... tomcatUrlN

I'm trying to use the plugin to iterate over a list, calculated at runtime by another Mojo that check how many properties starting with tomcatUrl are set.
Then I create a content with ,2,...N, and configure tomcat install mojo with ${tomcatUrl@item@}
It works great !

BUT, if only the first one is set, my content looks like so the plugin invoke nothing.
That's because, in AbstractIteratorMojo the getItems() methods check with isContentSet() there is a non empty value.
And in my case, I don't want to rename my first var as tomcatUrl1 ....

So i'd like

Prop 1) a new property to allow empty item ==> no trim() in isContentSet().
Prop 2) change the getItems() to not check if the content is set

protected List<String> getItems() throws MojoExecutionException {
    List<String> result = new ArrayList<String>();
    if (isItemsSet()) {
        result = items;
    } else {
        result = getContentAsList();
    } 

    return result;
}

Remote mojo-executor

I had changed the code to get it working with Maven 3.1 so the majority of the code is inside the plugin so move the rest as well and remove the dependency to mojo-executor.

Prefix output message with current Item

Hello,

Thanks for your great plugin !

I get a bit confused when looking at the output of my command.

Would it be possible to prefix the output with the current processed item?

  • either prefix each line at the output:
    [item] blablabla
  • either complete the fina failing message:
    [ERROR] Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.5.1:iterator (default) ... for item :

failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.2

Hello,when i run mvn validate -DrvMonitorBase=<RV-Monitor_HOME>,i meet a error:failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.2executor on project javamop:command execution failed.can not run program "mvn" <in directory "E:\jAVAMOP\javamop-4.2">:CreateProcess error=2,系统找不到指定文件。

How to work with maven-ear-plugin?

Hi,
We are using V0.2 of iterator-maven-plugin since customer's environment JDK only support 1.6. And we are trying to build ear by different server instances such as SIT server(sit-inst1, sit-inst2) and UAT server(uat-inst1, uat-inst2) and PROD server(prod-inst1, prod-inst2).
I have add the war dependencies on the pom.xml, but when I try to build, get error as below:
org.apache.maven.plugin.MojoFailureException: Artifact[war:com.hbsm.treats:tts-web] is not a dependency of the project.
And the content of the pom.xml as below:
`

4.0.0
tts-ear
com.hbsm.treats
tts-ear
0.0.1-SNAPSHOT
jar

<dependencies>
	<dependency>
		<groupId>com.hbsm.treats</groupId>
		<artifactId>tts-hats</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<type>war</type>
	</dependency>
	<dependency>
		<groupId>com.hbsm.treats</groupId>
		<artifactId>tts-web</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<type>war</type>
	</dependency>
</dependencies>

<build>
	<plugins>	
		<plugin>
			<groupId>com.soebes.maven.plugins</groupId>
			<artifactId>iterator-maven-plugin</artifactId>
			<version>0.2</version>
			<executions>
				<execution>
					<phase>package</phase>
					<goals><goal>executor</goal></goals>
					<configuration>
						<content>T5,T6</content>
						<pluginExecutors>
							<pluginExecutor>
								<plugin>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-ear-plugin</artifactId>
									<version>2.10.1</version>
								</plugin>
								<goal>ear</goal>
								<configuration>
									<version>5</version>
									<skinnyWars>true</skinnyWars>
									<finalName>${item}ttsEAR</finalName>
									<filtering>true</filtering>
									<modules>
										<webModule>
											<groupId>com.hbsm.treats</groupId>
											<artifactId>tts-web</artifactId>
											<bundleFileName>ttsWEB.war</bundleFileName>
											<contextRoot>/ttsweb</contextRoot>
										</webModule>
										<webModule>
											<groupId>com.hbsm.treats</groupId>
											<artifactId>tts-hats</artifactId>
											<bundleFileName>ttsHATS.war</bundleFileName>
											<contextRoot>/ttsHATS</contextRoot>
										</webModule>										
									</modules>
								</configuration>
							</pluginExecutor>
						</pluginExecutors>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>
`

Set different properties for filtering during iteraotor

pom.xml:

<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>dev</item>
                    <item>prod1</item>
                    <item>prod2</item>
                </items>
                <pluginExecutors>
                    <pluginExecutor>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-assembly-plugin</artifactId>
                            <version>2.6</version>
                        </plugin>
                        <goal>single</goal>
                        <configuration>
                            <delimiters>
                                <delimiter>@</delimiter>
                            </delimiters>
                            <descriptors>
                                <descriptor>${project.basedir}/src/main/assembly/common.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </pluginExecutor>
                </pluginExecutors>
            </configuration>
        </execution>
    </executions>
</plugin>

When assembly different packages, I need filter some properties for the resources file, and I do not want to specified different properties files, I wonder if I can set accordingly properties during each iterator?

assembly file:

<assembly
        xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

    <id>${item}</id>
    <formats>
        <format>war</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>${basedir}/target/${project.build.finalName}-spring</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
            <excludes>
                <exclude>**/application.yaml</exclude>
            </excludes>
        </fileSet>
    </fileSets>
    <files>
        <file>
            <source>${basedir}/src/main/resources/application.yaml</source>
            <outputDirectory>/WEB-INF/classes</outputDirectory>
            <filtered>true</filtered>
        </file>
    </files>
</assembly>

inherit plugin configuration

To avoid a lot of repetition in my pom files, and as a means to configure globally, I often pre-configure a plugin like with the logLevel here

<build>
  <plugins>
    <plugin>
      <groupId>com.soebes.maven.plugins</groupId>
      <artifactId>echo-maven-plugin</artifactId>
      <version>0.4.0</version>
        <execution>
          <id>echo</id>
          <phase>none</phase>
          <goals>
            <goal>echo</goal>
          </goals>
          <configuration>
            <logLevel>DEBUG</logLevel>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

And then i expect to inherit that configuration in a child project

<build>
  <plugins>
    <plugin>
      <groupId>com.soebes.maven.plugins</groupId>
      <artifactId>echo-maven-plugin</artifactId>
        <execution>
          <id>echo</id>
          <phase>package</phase>
          <configuration>
            <echos>
              <echo>This is line number one</echo>
              <echo>This is line number two</echo>
              <echo>This is line number three</echo>
            </echos>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

But now with the iterator plugin it seems I can't inherit configuration

<build>
  <plugins>
    <plugin>
      <groupId>com.soebes.maven.plugins</groupId>
      <artifactId>iterator-maven-plugin</artifactId>
      <version>0.5.0</version>
      <executions>
        <execution>
          <id>echo</id>
          <phase>package</phase>
          <goals>
            <goal>iterator</goal>
          </goals>
          <configuration>
            <items>
              <item>one</item>
              <item>two</item>
              <item>three</item>
            </items>
            <pluginExecutors>
              <pluginExecutor>
                <plugin>
                  <groupId>com.soebes.maven.plugins</groupId>
                  <artifactId>echo-maven-plugin</artifactId>
                  <version>0.4.0</version>
                </plugin>
                <goal>echo</goal>
                <configuration>
                  <echos>
                    <echo>This is line number @item@</echo>
                  </echos>
                </configuration>
              </pluginExecutor>
            </pluginExecutors>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Can I suggest adding a pluginExecutor/id tag that will cause the executor to inherit configuration from the plugin execution identified.

Add possibility to set properties for each item

I'm using iterator plugin in Eclipse Che project https://github.com/eclipse/che-lib/blob/master/websocket-terminal/pom.xml

I need to build golang application for different architectures. It requires environment variable. I use maven exec plugin and would want to make pom more pretty with iterator plugin. But it is not possible to set these variables because I can't set properties for each item.
It would be really useful if iterator plugin supports such configuration:

<items>
    <item>
        <value>linux_amd64</value>
        <properties>
            <goos>linux</goos>
            <goarch>amd64</goarch>
        </properties>
    </item>
    <item>
        <value>linux_arm7</value>
        <properties>
            <goos>linux</goos>
            <goarch>arm</goarch>
            <goarm>7</goarm>
        </properties>
    </item>
</items>

Iterator should not fail with no item

I have tried example using <content> echoing eins, zwei, drei
if content is empty , it fails in

[ERROR] Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.4:iterator (default) on project content-testempty: You can use only one element. Either items, itemsWithProperties, content or folder element but not more than one of them. -> [Help 1]

Logically , I would have expected that this does nothing in such a case , eventually logging that there is nothing to do but not failing( or if you prefer to see it failing then it should not give this error message but something like ' no item found.. ') .

pom.xml.zip

Folder Iterator as suggested in Readme

We would like to use this plugin in order to iterate over a list of folders and carry out a specific action for each folder name. At the moment we need to hard-code the folder names in order to achieve this, but this is not very flexible as it requires us to change the configuration every time we add another folder. (This is not uncommon for our use case, since each folder contains a themed set of icons that need to be converted to a spritesheet, and the number of themes is likely to increase with time.) In the Readme you you mention exactly this use case as a potential "strange idea" -- that a folder could be specified and each subfolder name becomes an item. If this were implemented it would be a definite improvement for us. :)

Unable to iterate over exec maven plugin

Hello,

I have a problem with iterator-maven-plugin which cause an error when iterating over exec-maven-plugin. The other plugin isn't able to get dependencies from the POM when it is executed by iterator.

mvn clean package

[...]

[INFO] --- iterator-maven-plugin:0.3:iterator (default) @ test-iterator-with-exec ---
[INFO] ------ (1) org.codehaus.mojo:exec-maven-plugin:1.4.0:java
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
        at com.vdubus.test.Main.main(Main.java:8)
        ... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Executing it without iterator does work.

I have created a small project as a showcase (both configurations with and without iterator are in it).

test-iterator-with-exec.zip

Support for maven-ant-plugin

The maven-ant-plugin requires some properties to be defined in , but it should be possible to "fake" it when defining items to iterate

How to access itemWithProperty values

<itemsWithProperties>
                                <itemWithProperty>
                                    <name>videos</name>
                                    <properties>
                                        <key>video1.mp4</key>
                                    </properties>
                                </itemWithProperty>
                            </itemsWithProperties>

How do I access the value video1.mp4?

Fix build problem in integration test

http://ci.soebes.de:8080/view/SoEBeS/job/iterator-maven-plugin/ws/target/it/basicTest/build.log/*view*/

[ERROR] Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT:executor (default) on project basic-test: Execution default of goal com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT:executor failed: Plugin com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT or one of its dependencies could not be resolved: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT:executor (default) on project basic-test: Execution default of goal com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT:executor failed: Plugin com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT or one of its dependencies could not be resolved: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT:executor failed: Plugin com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT or one of its dependencies could not be resolved: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:87)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin com.soebes.maven.plugins:iterator-maven-plugin:0.3-SNAPSHOT or one of its dependencies could not be resolved: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:208)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:357)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:325)
at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:180)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:83)
... 20 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:200)
... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.hamcrest:hamcrest-core:jar:1.3 in file:///home/build/.jenkins/workspace/iterator-maven-plugin/.repository was cached in the local repository, resolution will not be reattempted until the update interval of it-repo has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:232)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:599)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:518)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
... 27 more

Enhance output

It would be nice having the iterated variable value being output during the run.

Parallelisation of iterator

Would it be possible to add a 'parallel' flag to the iterator goal? I have a collection of 'environment.zip' assemblies which take a few seconds each to build. Being able to fork each iteration would be great

<folder> detects only sub-folders not files

I recently used "iterator" to perform actions on some files on some folder, only to discover, to my disappointment I have to admit, that "iterator" only detects sub-folders of and not the files in it.

Having followed the examples precisely, I am confident that the implementation handles sub-folders only.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.