上传jar到中央仓库

第一步创建项目并发布到github

 

第二部 创建账号 并新建问题

错误情况一

Do you own the domain fastboot.com? If so, please verify ownership via one of the following methods:
* Add a TXT record to your DNS referencing this JIRA ticket: OSSRH-55669 (Fastest)
* Setup a redirect to your Github page (if it does not already exist)

If you do not own this domain, please read:
http://central.sonatype.org/pages/choosing-your-coordinates.html
You may also choose a groupId that reflects your project hosting, in this case, something like

Would you like to use a free managed security reporting service (recommended)?
Put https://hackerone.com/central-security-project/reports/new as your project's security issue reporting URL. We'll take care of the rest.
For more details on the Central Security Project, visit

意思是groupid, 命名必须是自己的域名

自己有域名 两种认证方式 新建dns解析

将自己的网站重定向到github项目地址

还可以使用开源的代码托管平台

例如github

则 groupid 为 com.github.用户名

至此问题一解决

问题二,怎样证明此仓库是你的

 please create a public repo called OSSRH-55669 to verify gitee account ownership

大概意思是创建一个项目名为OSSRH-55669 的项目,证明此仓库是你本人的

至此问题二解决

在pom文件中添加

 <!-->开发者的信息<-->
    <developers>
        <developer>
            <name>fastsite</name>
            <email>fastsite@163.com</email>
        </developer>
    </developers>

    <!-->项目的版本管理地址<-->
    <scm>
        <url>https://gitee.com/fastsite/fastsite</url>
    </scm>
    <!-->发布的地址<-->
    <distributionManagement>
        <repository>
            <id>snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

注意在编辑时设置字符集

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           
       <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

在 .m2/settings.xml 中添加用户名 密码

 </servers> 
    <server>
    <id>snapshots</id>
    <username>上面注册时用户名</username>
    <password>上面注册时密码</password>
  </server>
  </servers>

最后执行发布命令

mvn clean deploy

然后查看结果 

https://oss.sonatype.org/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值