您的位置:首页 > 其它

maven 上传项目或者jar到私服

2015-07-29 04:32 381 查看
首先到私服管理页面在配置中允许redeploy,maven 上传jar需要在某一个项目下,执行以下命令:

mvn deploy:deploy-file -DgroupId=com.need.http -DartifactId=need-http -Dversion=0.1.0 -Dpackaging=jar -Dfile=/Users/shenyb/Downloads/http.jar  Downloads -DrepositoryId=maven-repository-inner -Durl=http://ip:port/nexus/content/repositories/thirdparty/


需要配置信息为:

.settings文件,可以喂maven安装目录,也可以是当前用户.m2下,一个是全局,一个是当前用户配置

<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>


如果要depoly某一个项目:

可以直接在项目下执行mvn deploy。

maven的jetty插件运行配置:

<!-- 添加此插件以便启动jetty -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<encoding>UTF-8</encoding>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>


启动时可以制定端口:

mvn -Djetty.port=9999 jetty:run
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: