Maven: best way of linking custom external JAR to my project?

You can create an In Project Repository, so you don’t have to run mvn install:install-file every time you work on a new computer <repository> <id>in-project</id> <name>In Project Repo</name> <url>file://${project.basedir}/libs</url> </repository> <dependency> <groupId>dropbox</groupId> <artifactId>dropbox-sdk</artifactId> <version>1.3.1</version> </dependency> /groupId/artifactId/version/artifactId-verion.jar detail read this blog post https://web.archive.org/web/20121026021311/charlie.cu.cc/2012/06/how-add-external-libraries-maven

Controlling Maven final name of jar artifact

For Maven >= 3 <packaging>jar</packaging> <build> <finalName>WhatEverYouLikey</finalName> </build> See bug report/documentation. (Credits to Matthew’s and his comment) For older Maven versions You set the finalName property in the plugin configuration section: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> <configuration> <finalName>myJar</finalName> </configuration> </plugin> As indicated in the official documentation.

Including dependencies in a jar with Maven

You can do this using the maven-assembly plugin with the “jar-with-dependencies” descriptor. Here’s the relevant chunk from one of our pom.xml’s that does this: <build> <plugins> <!– any other plugins –> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>

Importing Maven project into Eclipse

I want to import existing maven project into eclipse. I found 2 ways to do it, one is through running from command line mvn eclipse:eclipse and another is to install maven eclipse plugin from eclipse. What is the difference between the both and which one is preferable? The maven-eclipse-plugin is a Maven plugin and has … Read more

Make Maven to copy dependencies into target/lib

This works for me: <project> … <profiles> <profile> <id>qa</id> <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>