iterator-maven-plugin icon indicating copy to clipboard operation
iterator-maven-plugin copied to clipboard

<folder> detects only sub-folders not files

Open eliasbalasis opened this issue 9 years ago • 11 comments

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?

eliasbalasis avatar Oct 14 '16 16:10 eliasbalasis

The iterator was designed to use folders only and not files...can you give a real example where it might make sense to use iterating over files instead of folders.

khmarbaise avatar Oct 15 '16 11:10 khmarbaise

Thanks for looking at this, my actual making sense problem is un-signing a series of JAR files using webstart-maven-plugin

eliasbalasis avatar Oct 15 '16 12:10 eliasbalasis

For your convenience the iterated webstart-maven-plugin doesn't work with folders, although it states otherwise, so I am forced to go through a complicated series of steps via ant and other custom tasks only to increase complexityof my build

I hope this helps justifyinfthe requirement

eliasbalasis avatar Oct 15 '16 14:10 eliasbalasis

After having given enough thought,

I believe it makes sense to extend iterator with a common path-like selection having , etc. for more flexibility and control

Let me know your thoughts.

eliasbalasis avatar Oct 15 '16 17:10 eliasbalasis

Could you make a example project which shows the wished behaviour ?

khmarbaise avatar Oct 29 '16 11:10 khmarbaise

It is not very easy to produce a full project to demonstrate the exact problem, I can mostly describe.

So, imagine a folder hierarchy with JAR files that need to be un-signed

<plugin>
  <groupId>com.soebes.maven.plugins</groupId>
  <artifactId>iterator-maven-plugin</artifactId>
  <version>0.4</version>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>iterator</goal>
      </goals>
      <configuration>
        <folder>${project.basedir}/repository</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.codehaus.mojo</groupId>
              <artifactId>webstart-maven-plugin</artifactId>
              <version>:1.0-beta-8-SNAPSHOT</version>
            </plugin>
            <goal>unsign</goal>
            <configuration>
              <jarPath>@item@</jarPath> <!-- item must be full path and file -->
            </configuration>
          </pluginExecutor>
        </pluginExecutors>
      </configuration>
    </execution>
  </executions>
</plugin>

I hope this helps.

eliasbalasis avatar Oct 29 '16 11:10 eliasbalasis

Ah that makes it more clear..So the iteration should be done on a file base with absolute file path...and not on folder base....I think that needs an other goal...but I will see...

khmarbaise avatar Oct 29 '16 11:10 khmarbaise

I am having a similar issue, any update on this ?

johnnyquestep avatar Mar 10 '17 14:03 johnnyquestep

I have used "Ant" script as replacement, more confusing but works

eliasbalasis avatar Mar 10 '17 18:03 eliasbalasis

+1 Please add this feature. We need it for signing files

martinbachtold avatar Jun 21 '17 14:06 martinbachtold

any updates?

DmitryZagr avatar Aug 25 '20 10:08 DmitryZagr