Search This Blog

Thursday, February 20, 2014

Adding Unmanaged Dependencies to a Maven Project

Adding Unmanaged Dependencies to a Maven Project

To add a local jar to maven build you need to deploy it to your project's local repository (that's NOT your local maven's repository placed in home/user/.m2 folder).

Adding the jar file as a system dependency won't work as the jar would have to be copied by hand to every device where you want to install your application.

Changing local system dependency to maven's local project repository:

            <dependency>
            <groupId>com.wagnerandade</groupId>
            <artifactId>coollection</artifactId>
            <version>0.2.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/coollection-0.2.2.jar</systemPath>
        </dependency>

Use the command to register a local project repository:

mvn deploy:deploy-file -Durl=file:///android/myapplication/repo/ -Dfile=coollection-0.2.2.jar -DgroupId=com.wagnerandade -DartifactId=coollection -Dpackaging=jar -Dversion=0.2.2



and change the pom to:

          <repositories>
        <repository>
            <id>project.local</id>
            <name>project</name>
            <url>file:${project.basedir}/repo</url>
        </repository>
    </repositories>

[...]

        <dependency>
            <groupId>com.wagnerandade</groupId>
            <artifactId>coollection</artifactId>
            <version>0.2.2</version>
     </dependency>


PDF tutorial



1 comment:

  1. But hey, there are going to be a lot more replica watches Daytonas around for me when people drop them for the new one so I not complaining. I know many that can buy these watches like rolex replica sale but you talking about the folks that are perhaps watches store generation elites that spend money like that, or perhaps the one hit start up wonders that make it rich. Either way you not completely wrong but even the uber rich are spend like that, it probably the reason they are wealthy in the first place. If the replica watches sale is a fraud and rolex should be taken down with extreme prejudice. That is like one of those shocking days in the world when every few years when they have a significant anniversay and they do all the interviews. The rado replica gets high marks from me for having a well proportioned case. Thin and wearable uncommon for a modern mechanical chronograph. Let them run a site see how difficult fake rolex sale can be to keep the content flowing, how much of your own time is spent on keeping the site up and running and keep everyone happy.

    ReplyDelete

If you like this post, please leave a comment :)