Add jar to Maven project without installing to repository (better approach) 

Joined:
08/13/2009
Posts:
172

October 09, 2013 14:40:59    Last update: October 09, 2013 14:40:59
This example adds Salesforce dataloader jar to a Maven project.
  1. Create a project local repository and install the Salesforce jar (oneline, broken up for readability).
    mvn install:install-file -DlocalRepositoryPath=m2repo -DcreateChecksum=true 
    -Dpackaging=jar -Dfile=lib/dataloader-28.0.0-uber.jar -DgroupId=com.salesforce 
    -DartifactId=dataloader -Dversion=28.0.0
    

  2. Add repository and dependency in pom.xml:
    <repositories>
    	<repository>
    	    <id>m2repo</id>
    	    <url>file://${project.basedir}/m2repo</url>
    	</repository>
    </repositories>
    
    <dependencies>
    	<dependency>
    	    <groupId>com.salesforce</groupId>
    	    <artifactId>dataloader</artifactId>
    	    <version>28.0.0</version>
    	</dependency>
    </dependencies>
    

Share |
| Comment  | Tags