Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active November 6, 2020 03:09
Show Gist options
  • Save sandipchitale/48e69082dd33587bccf1cc43384b65d0 to your computer and use it in GitHub Desktop.
Save sandipchitale/48e69082dd33587bccf1cc43384b65d0 to your computer and use it in GitHub Desktop.
Generic mechanism to install self to local repository in m2 folder
<!--
To use this goal invoke it like this:
> mvnw install:install-file@m2
This will install the artifact in local folder m2/repository
-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>m2</id>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<packaging>${project.packaging}</packaging>
<file>${project.build.directory}/${project.build.finalName}.${project.packaging}</file>
<localRepositoryPath>m2/repository</localRepositoryPath>
<pomFile>pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment