1

I'm using a maven-dependency-plugin to unpack a jar that contains several .sh scripts and that works as expected.

So I'm able to copy the files into the <outputDirectory>${project.build.dir}/main-scripts</outputDirectory>

But now I want to rename only one of them from run.sh to run-main.sh while unpacking. How could it be achieved with the dependency plugin?

<plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.main.libs</groupId>
                                    <artifactId>main-scripts</artifactId>
                                    <version>LATEST</version>
                                    <type>jar</type>
                                    <includes>*.sh</includes>
                                    <outputDirectory>${project.build.dir}/main-scripts</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
samba
  • 2,821
  • 6
  • 30
  • 85

0 Answers0