julika Zen
julika Zen

Reputation: 357

maven - copying a file during build

I have 2 Maven projects say project A and project B. it is managed using svn repository. Either I want a copy a file from project A to project B during build Or using some other command in maven. is it possible?please help me. Thanks in advance

Upvotes: 1

Views: 498

Answers (1)

mihai.ciorobea
mihai.ciorobea

Reputation: 741

Yes, you can use "maven-antrun-plugin"

<build>
    <plugins>
        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>copy-assets</id>
                    <phase>package</phase>
                    <configuration>
                        <target>
                            <move file="path_from"
                                  tofile="path_to">
                            </move>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

or you can use copy-resources goal in maven-resources-plugin.

Example here

Upvotes: 1

Related Questions