Skip to content

Instantly share code, notes, and snippets.

@Carlos-Augusto
Created August 23, 2021 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Carlos-Augusto/07229ac1cf03406e0203a95525b99a0c to your computer and use it in GitHub Desktop.
Save Carlos-Augusto/07229ac1cf03406e0203a95525b99a0c to your computer and use it in GitHub Desktop.
Installs java lib into local maven repo
<!--Assuming you have to use a jar that can't be downloaded through a lib management system like maven or similar, you may want to
have this lib installed locally or as part your repo.
This is not a nice pattern, but sometimes, it is required.
You can use the install plug-in to install the jar located a particular place, you have to define the description of the
Locally installed lib.-->
<dependencies>
<dependency>
<groupId>com.cryptshare.api</groupId>
<artifactId>cryptshare-api</artifactId>
<version>5.0.0.184</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<groupId>com.cryptshare.api</groupId>
<artifactId>cryptshare-api</artifactId>
<version>5.0.0.184</version>
<packaging>jar</packaging>
<file>${basedir}/jars/cryptshare-api-5.0.0.184.jar</file>
<generatePom>true</generatePom>
</configuration>
<executions>
<execution>
<id>install-jar-lib</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment