maven安装 maven上传jar包到库里面

maven的安装与配置:http://pansanday.blog.163.com/blog/static/381662802012727103454743/

maven上传jar包到库里面:

将私有的jar包或者maven(http://maven.apache.org)找不到匹配的jar包,导入到本地库中:

mvn install:install-file -Dfile=d:/Downloads/apache-activemq-5.5.0/lib/activemq-core-5.5.0.jar -DgroupId=org.apache.activemq -DartifactId=activemq-core -Dversion=5.5.0 -Dpackaging=jar

解析:

mvn install:install-file  -Dfile=外部包的路径

                 -DgroupId=外部包的groupId  

                 -DartifactId=外部包的artifactId 

                 -Dversion=外部包的版本号  

                 -Dpackaging=jar

记住这是本地库!!!

下面是上传到远程库中:

pom.xml中加上:

<distributionManagement>

		<snapshotRepository>

			<id>nexus-snapshots</id>

			<name>Snapshots</name>

			<url>**********************************</url>

		</snapshotRepository>

		<repository>

			<id>nexus-release</id>

			<name>Releases</name>

			<url>**********************************</url>

		</repository>

	</distributionManagement>

 maven安装目录下的settings.xml中的servers加上:

<server>

    	<id>nexus-release</id>

    	<username>***********</username>

    	<password**********</password>

    </server>

    <server>

    	<id>nexus-snapshots</id>

    	<username>**********</username>

    	<password>*********</password>

    </server>

 然后右击运行项目,输入clean  deploy

OK!

你可能感兴趣的:(maven)