Heroku deploy local jar to Maven Dependencies

Sometime a jar is not available via Maven Central Repository and you need to load a jar from your local filesystem. Copy the jar file to a lib directory in your project.

Execute the following command via command line

mvn deploy:deploy-file -Durl=file:salesforce/lib/ 
-Dfile=salesforce/lib/emp-connector-0.0.1-SNAPSHOT-phat.jar 
-DgroupId=com.salesforce.conduit 
-Dpackaging=jar 
-Dversion=0.0.1-SNAPSHOT 
-DartifactId=emp-connector

Add the following to maven pom.xml

 <repositories>
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file:${project.basedir}/lib</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
 </repositories>
 <dependencies>
    <dependency>
        <groupId>com.salesforce.conduit</groupId>
        <artifactId>emp-connector</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
</dependencies>

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s