在maven.oschina上传自有jar包

一  配置第三方库

maven.oschina目前把第三方构件放在了http://maven.oschina.net/content/repositories/thirdparty/下面,并且没有配置到public group里,所以在使用时需要另外指向镜像地址:

<mirror>
      <id>osc</id>
      <mirrorOf>central</mirrorOf>
      <name>Nexus osc</name>
      <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
	<mirror>
      <id>osc-thirdparty</id>
      <mirrorOf>thirdparty</mirrorOf>
      <name>Nexus osc thirdparty</name>
      <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    </mirror>

然后配置仓库:

<profile>
		<id>my_nexus</id>
		<repositories>
			<repository>
				<id>my_repo</id>
				<name>my_repo</name>
				<url>http://maven.oschina.net/content/groups/public/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>true</enabled>
				</snapshots>
			</repository>
			<repository>
				<id>my_3thparty_repo</id>
				<name>my_3thparty_repo</name>
				<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>true</enabled>
				</snapshots>
			</repository>
		</repositories>
		<pluginRepositories>
			<pluginRepository>
				<id>my_plugin_repo</id>
				<name>my_plugin_repo</name>
				<url>http://maven.oschina.net/content/groups/public/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>true</enabled>
				</snapshots>
			</pluginRepository>
		</pluginRepositories>
	</profile>
  </profiles>

二  上传自有资源

在http://maven.oschina.net/home.html页面点击上传项目,进入授权页,如果已经有oschina的账号,则使用之登陆,然后在上传页面配置待上传资源:

在maven.oschina上传自有jar包_第1张图片

点击“提交”后,页面提示上传成功的信息。如果没有及时提示也不要着急,等待会就好了(有时服务器不在状态)。

上传后,一般情况下马上可以找到刚才上传的jar文件,但是也有服务器偷懒的情况,等几分钟就好了,如:

在maven.oschina上传自有jar包_第2张图片

你可能感兴趣的:(在maven.oschina上传自有jar包)