eclipse上传项目到公司私服

一、根pom.xml配置:
 

<!--下载的远程仓库的配置-->
<repositories>
        <repository>
            <id>microseer49</id>
            <name>libs-release</name>
            <url>http://mvnrepo.microseer.com:8081/artifactory/libs-release</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases><enabled>true</enabled></releases>
        </repository>
        <repository>
            <id>snapshots</id>
            <name>libs-snapshot</name>
            <url>http://mvnrepo.microseer.com:8081/artifactory/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases><enabled>true</enabled></releases>
        </repository>
        <repository>
            <id>aliyun.com</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </repository>
    </repositories>
<!--上传的远程仓库的位置-->
    <distributionManagement>
        <repository>
            <id>microseer49</id>
            <name>microseer49-releases</name>
            <url>http://mvnrepo.microseer.com:8081/artifactory/ext-release-local</url>
        </repository>
        <snapshotRepository>
            <id>microseer49</id>
            <name>microseer49-snapshots</name>
            <url>http://mvnrepo.microseer.com:8081/artifactory/ext-snapshot-local</url>
        </snapshotRepository>
    </distributionManagement>

二、maven插件依赖

<plugins>
            <plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<mainClass>none</mainClass>     <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
					<classifier>execute</classifier>    <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
        </plugins>

三、setting.xml配置:

<servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
	<!--为了解决deploy上传找不到id问题,需要注意的是,
settings.xml中server元素下id的值必须与POM中
repository或snapshotRepository下id的值完全一致。
将认证信息放到settings下而非POM中,
是因为POM往往是它人可见的,而settings.xml是本地的-->
	<server>   
		<id>microseer49</id>   
		<username>deploy</username>   
		<password>123456</password>   
	</server>
	<server>   
		<id>snapshots</id>   
		<username>deploy</username>   
		<password>123456</password>   
	</server>
  </servers>


<mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
	 <!--为了解决下载jar包从maven仓库过慢问题-->
	 <mirror>
		<id>nexus-aliyun</id>
		<mirrorOf>central</mirrorOf>
		<name>Nexus aliyun</name>
		<url>http://maven.aliyun.com/nexus/content/groups/public</url>
	</mirror>
  </mirrors>

四、eclipse命令:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值