James Raitsev
James Raitsev

Reputation: 96431

mv instruction as part of Maven build

As part of my maven build, i'd like to take the target and

mv current_target_snapshot_123 current_target

How can this be done please?

Upvotes: 1

Views: 694

Answers (3)

khmarbaise
khmarbaise

Reputation: 97447

You can use the maven-dependency-plugin to do the copy into different location and strip the versions of the artifact.

Upvotes: 1

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 298978

There are two solutions that I am aware of:

  1. Maven Antrun Plugin (see nwinkler's answer)
  2. GMaven Plugin with an embedded Groovy Script

    <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <executions>
            <execution>
                <phase>generate-resources</phase>
                <goals>
                    <goal>execute</goal>
                </goals>
                <configuration>
                    <source>
                    new File('somefilename').renameTo('someotherfilename');
                    </source>
                </configuration>
            </execution>
        </executions>
    </plugin>
    

Upvotes: 2

nwinkler
nwinkler

Reputation: 54457

I would use a combination of the following:

Upvotes: 3

Related Questions