url : http://maven.apache.org
文件路径:http://repo.maven.apache.org/maven2/ ${groupId} / ${artifactId} / ${version}/
修改本地路径:
配置文件 %MAVEN_HOME%/conf/settings.xml 中添加
<settings>
...
<localRepository>路径</localRepository>
...
</settings>
Eclipse --> Maven --> User Settings --> User Settings 引入配置
maven命令
安装jar到本地maven库
mvn install:install-file
-Dfile=<文件>
-DgroupId=<groupId>
-DartifactId=<artifactId>
-Dversion=<version>
-Dpackaging=<jar>
-DgeneratePom=true
pom.xml配置
打war包
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
打可执行 jar包
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>执行类</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
项目编译Jkd版本
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>