4

I want do display the URL to a JAR that was deployed to our maven repo at the end of my build job. (Basically the "link" where the dependency - the JAR - can be downloaded from the repository server)

So how to display the remote repository URL of a dependency on command line?

gorootde
  • 4,003
  • 4
  • 41
  • 83

1 Answers1

0

I suggest you to compose the URL from the parameters in the very pom. Example:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.8</version>
            <executions>
                <execution>
                    <id>deploy-message</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <echo>deploying to url=${project.distributionManagement.repository.url}/${project.groupId}/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar</echo>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
        </plugin>

(This message will appear at the same time the deploy is being performed, but you can set it to whatever phase you want. Or include it into a Maven profile.)

Little Santi
  • 8,563
  • 2
  • 18
  • 46