Maven导入第三方jar包

mvn install:install-file
  -Dfile=<path-to-file>
  -DgroupId=<group-id>
  -DartifactId=<artifact-id>
  -Dversion=<version>
  -Dpackaging=<packaging>
  -DgeneratePom=true

Where: <path-to-file>  the path to the file to load
       <group-id>      the group that the file should be registered under
       <artifact-id>   the artifact name for the file
       <version>       the version of the file
       <packaging>     the packaging of the file e.g. jar

 示例:

mvn install:install-file
  -Dfile=D:\commons-dbcp.jar
  -DgroupId=commons-dbcp
  -DartifactId=commons-dbcp
  -Dversion=1.4
  -Dpackaging=jar
  -DgeneratePom=true

 然后在pom.xml文件中引入:

<dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
      <version>1.4</version>
    </dependency>

 

 

你可能感兴趣的:(maven)