回顾此前的安装教程:https://blog.csdn.net/qq_52495761/article/details/135400783
1、在Gitee中创建一个空仓库
2、找到你需要上传的代码的根目录,点击鼠标右键找到Git Bash Here
3、进入命令Git Bash Here界面
4、具体上传步骤Bash如下:
1|git init
2|git remote add origin 你所创建的仓库地址
3|git pull origin master
4|git add .
5|git commit -m "描述"
6|git push origin master
正常通过以上的步骤再打开Gitee,刷新一下就能看见你所提交的代码
如果你需要将已经上传的,但是又修改过的再次上传,只需要执行4,5,6即可
git pull --rebase origin master
https://issues.sonatype.org/secure/Dashboard.jspa
到这个网站注册登录,保存好你的用户名和密码,在后面发布jar包有用。
1、下载地址:https://www.gpg4win.org/download.html
2、若觉得下载慢可在此处获取:
链接:https://pan.baidu.com/s/1HTRpilCSZCaX3K0T746PXg?pwd=kdom
提取码:kdom
//上传
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --send-keys 你自己的密钥(去重空格)
//检验
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 你自己的密钥(去重空格)
<name>自定义名name>
<groupId>你自己的groupId>
<artifactId>你自己的artifactId>
<version>0.0.1-SNAPSHOTversion>
<description>描述description>
<properties>
<serverId>ossrhserverId>
<java.version>1.8java.version>
<projectUrl>你自己的projectUrl>
properties>
<developers>
<developer>
<name>name>
<email>email>
<url>${projectUrl}url>
developer>
developers>
<servers>
<server>
<id>ossrhid>
<username>你自己的username>
<password>你自己的password>
server>
servers>
<profile>
<id>ossrhid>
<activation>
<activeByDefault>trueactiveByDefault>
activation>
<properties>
<gpg.executable>gpggpg.executable>
<gpg.passphrase>你自己的gpg.passphrase>
<gpg.homedir>${user.home}/gnupggpg.homedir>
<maven.compiler.source>1.8maven.compiler.source>
<maven.compiler.target>1.8maven.compiler.target>
<maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion>
properties>
profile>
<url>${projectUrl}url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txturl>
<distribution>repo,manualdistribution>
license>
licenses>
<scm>
<connection>${projectUrl}connection>
<developerConnection>${projectUrl}developerConnection>
<url>${projectUrl}url>
scm>
<distributionManagement>
<snapshotRepository>
<id>${serverId}id>
<name>OSS Snapshots Repositoryname>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/url>
snapshotRepository>
<repository>
<id>${serverId}id>
<name>OSS Staging Repositoryname>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/url>
repository>
distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-compiler-pluginartifactId>
<configuration>
<source>8source>
<target>8target>
configuration>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-source-pluginartifactId>
<version>2.2.1version>
<executions>
<execution>
<id>attach-sourcesid>
<goals>
<goal>jar-no-forkgoal>
goals>
execution>
executions>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-javadoc-pluginartifactId>
<version>2.9.1version>
<configuration>
<additionalparam>-Xdoclint:noneadditionalparam>
<aggregate>trueaggregate>
<charset>UTF-8charset>
<encoding>UTF-8encoding>
<docencoding>UTF-8docencoding>
configuration>
<executions>
<execution>
<id>attach-javadocsid>
<goals>
<goal>jargoal>
goals>
execution>
executions>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-gpg-pluginartifactId>
<version>1.5version>
<executions>
<execution>
<id>sign-artifactsid>
<phase>verifyphase>
<goals>
<goal>signgoal>
goals>
execution>
executions>
plugin>
<plugin>
<groupId>org.sonatype.pluginsgroupId>
<artifactId>nexus-staging-maven-pluginartifactId>
<version>1.6.7version>
<extensions>trueextensions>
<configuration>
<serverId>${serverId}serverId>
<nexusUrl>https://s01.oss.sonatype.org/nexusUrl>
<autoReleaseAfterClose>falseautoReleaseAfterClose>
configuration>
plugin>
plugins>
build>
注意部分:
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-gpg-pluginartifactId>
<version>1.5version>
<executions>
<execution>
<id>sign-artifactsid>
<phase>verifyphase>
<goals>
<goal>signgoal>
goals>
execution>
executions>
plugin>
配置完这些下一步是在idea中maven下点击deploy
**1、若点击部署时没有报错,而是直接显示下图内容,则不用看注意部分直接跳过:**
打包时可能会弹出让你输入密码(填的在setting.xml中配置的)
**2、若点击部署时报以下错误:**
**解决方法:**
1、可以将以下部分删除
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-gpg-pluginartifactId>
<version>1.5version>
<executions>
<execution>
<id>sign-artifactsid>
<phase>verifyphase>
<goals>
<goal>signgoal>
goals>
execution>
executions>
plugin>
2、或者将上面的部分替换成以下内容:
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-gpg-pluginartifactId>
<version>1.5version>
<configuration>
<skip>trueskip>
configuration>
plugin>
**两种方法选其一即可**
https://s01.oss.sonatype.org/#welcome
登陆(账号密码是sonatype平台注册的)
**能看到这些就是可以了,直接将依赖引到,你所需要的pom文件即可使用**
以上只是上传到自己的私服务仓库中,并未发布,个人学习以上足够带来便利,也能给别人,也不一定需要发布。