本地代码提交到私服并达成jar包记录

   记录下代码被打成jar包上传到私服以及git的。

  1.以自己的项目为例

    

 

 

  本地项目改好了之后,需要上传到私服。pom配置文件如下:

 

<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://公司私服地址/nexus/content/groups/public</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://公司私服地址m/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF8</encoding>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<forkMode>always</forkMode>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

  

   注意标红地方是两个地址。

 

  配置好后 执行 mvn install 命令 ,确认是否提交成功

 

   2.提交到git命令

    1)git init  

    初始化 

    2)去自己公司的git 私服上 新建服务,新建之后 clone 地址 

 

 

 

 

  3)git remote add origin clone地址 

    把项目提交到git私服

  4) git add -A

 5)git commit -m "注释"

6)git push  origin master

7.碰到的问题 

git提交冲突问题:

Updates were rejected because the tip of your current branch is behind
方案:

这时需要用git pull origin master --allow-unrelated-histories指令


参考:https://blog.csdn.net/qq_44701258/article/details/99087161  

posted @ 2020-11-04 16:19  Doyourself!  阅读(343)  评论(0编辑  收藏  举报