Yordan Borisov
Yordan Borisov

Reputation: 1652

Download war file from nexus with maven

If I have the artifactId, the groupId and the version how I can configure the pom.xml so maven will download test.war file from the nexus repository. I assume that this should happened in the

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            .....
            </plugin>

In the execution block. I already tried this but no luck:

    <execution>
    <phase>package</phase>
    <goals>
        <goal>copy</goal>
    </goals>
    <configuration>
        <artifactItems>
            <artifactItem>
                <artifactId>mytest</artifactId>
                <groupId>com.mytest</groupId>
                <version>${version}</version>
                <type>war</type>
                <destFileName>mytest-${version}.war</destFileName>
            </artifactItem>
        </artifactItems>
        <outputDirectory>${project.build.directory}</outputDirectory>
    </configuration>
</execution>

Upvotes: 0

Views: 3624

Answers (1)

Mykel Alvis
Mykel Alvis

Reputation: 1052

Are you certain that ${version} is being set properly for you? If you need the version of the current project, you should probably be using <version>${project.version}</version> and possibly setting up <dependencyManagement/> to handle that for you.

Upvotes: 1

Related Questions