打包私库
This commit is contained in:
@@ -42,10 +42,53 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>deploy-nexus</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>deploy-to-nexus</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.repository.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.snapshots.repository.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
</profiles>
|
||||
<properties>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<javaparser.version>3.25.10</javaparser.version>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<nexus.deploy.enabled>false</nexus.deploy.enabled>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<nexus.repository.id>fantaibao-fantaibao-maven-repository</nexus.repository.id>
|
||||
<nexus.snapshots.repository.url>${nexus.repository.url}</nexus.snapshots.repository.url>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<nexus.repository.url>http://192.168.3.25:18081/nexus/repository/maven-releases/</nexus.repository.url>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
64
pom.xml
64
pom.xml
@@ -14,6 +14,16 @@
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<javaparser.version>3.25.10</javaparser.version>
|
||||
|
||||
<!-- 制品库上传开关:默认关闭,开启方式见下方 deploy-nexus profile 说明 -->
|
||||
<nexus.deploy.enabled>false</nexus.deploy.enabled>
|
||||
<!-- 以下配置请按实际 Nexus 仓库填写 -->
|
||||
<!-- server.id 必须与 settings.xml 中 <server><id> 一致,不能用 mirror 的 id -->
|
||||
<nexus.repository.id>fantaibao-fantaibao-maven-repository</nexus.repository.id>
|
||||
<!-- 上传必须用 hosted 仓库;maven 是 group 仓库只能拉依赖不能 deploy -->
|
||||
<nexus.repository.url>http://192.168.3.25:18081/nexus/repository/maven-releases/</nexus.repository.url>
|
||||
<!-- 若 releases / snapshots 分仓,可覆盖此项;默认与 nexus.repository.url 相同 -->
|
||||
<nexus.snapshots.repository.url>${nexus.repository.url}</nexus.snapshots.repository.url>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -74,4 +84,58 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<!--
|
||||
制品库上传(默认关闭)
|
||||
|
||||
开启上传:
|
||||
mvn clean package -Dnexus.deploy.enabled=true
|
||||
或
|
||||
mvn clean package -Pdeploy-nexus
|
||||
|
||||
仅打包不上传(默认):
|
||||
mvn clean package
|
||||
|
||||
凭证配置:复制 deploy/settings-nexus.xml.example 到 ~/.m2/settings.xml 中对应节点并填写账号密码。
|
||||
server.id 必须与 nexus.repository.id 一致。
|
||||
-->
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>deploy-nexus</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>nexus.deploy.enabled</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.repository.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.snapshots.repository.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>deploy-to-nexus</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user