当前位置: 首页 > news >正文

5-Maven-setttings和pom.xml常用配置一览

5-Maven-setttings和pom.xml常用配置一览

setttings.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><localRepository>D:\MavenWarehouseBoCloud</localRepository><pluginGroups></pluginGroups><proxies></proxies><servers><server><id>bocloud</id><username>******</username><password>*******</password></server><server><id>bocloud-snapshot</id><username>******</username><password>*******</password></server></servers><mirrors><mirror><id>aliyun-central</id><mirrorOf>central</mirrorOf><name>aliyun-central</name><url>https://maven.aliyun.com/repository/central</url></mirror></mirrors><profiles><profile><id>bocloud</id><repositories><repository><id>bocloud</id><!-- 公司私服 --><url>http://****:**/##/maven-public/</url><releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases><snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots></repository>	</repositories><pluginRepositories><pluginRepository><id>bocloud</id><!-- 公司私服 --><url>http:/****:**/##/maven-public/</url><releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases><snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots></pluginRepository>    </pluginRepositories></profile></profiles><activeProfiles><activeProfile>bocloud</activeProfile><!--bocloud.booter.tomcat 是对于我们公司来讲基本每个项目中pom.xml都会配置的profile所以直接在settings中设置启用了 --><activeProfile>bocloud.booter.tomcat</activeProfile></activeProfiles>  
</settings>

pom.xml配置

父pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent></parent><groupId>com.bocloud</groupId><artifactId>*.*</artifactId><version>XXX-LTS</version><packaging>pom</packaging><description>BoCloud Cloud Operation Platform</description><properties><bocloud.cop.version>XXX-LTS</bocloud.cop.version><bocloud.common.version>XXX-LTS</bocloud.common.version></properties><modules>.......<module>bocloud.cop.*</module></modules><dependencyManagement><dependencies>...........<dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.1.0</version></dependency></dependencies></dependencyManagement><distributionManagement><repository><id>bocloud</id><name>BoCloud Release</name><url>${release.server.url}</url></repository><snapshotRepository><id>bocloud-snapshot</id><name>BoCloud Snapshot</name><url>${snapshot.server.url}</url></snapshotRepository></distributionManagement><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-release-plugin</artifactId><version>2.4.1</version></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version><configuration><updateReleaseInfo>true</updateReleaseInfo></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.5.1</version><configuration><source>21</source><target>21</target><encoding>${file_encoding}</encoding><skip>true</skip></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><skip>true</skip></configuration><version>3.0.0-M3</version></plugin></plugins></build>
</project>

子pom.xml: controller所在的module


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent></parent><modelVersion>4.0.0</modelVersion><artifactId>bocloud.cop.*</artifactId><version>${bocloud.booter.version}</version><dependencies>........<!--for spring boot 3--><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>2.0.7</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.11.0</version><configuration><parameters>true</parameters><source>21</source><target>21</target></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>3.3.0</version><configuration><archive><manifest><mainClass>com.bocloud.cop.***.Application</mainClass><addClasspath>true</addClasspath><useUniqueVersions>false</useUniqueVersions><classpathPrefix>libs/</classpathPrefix></manifest></archive></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><version>3.6.1</version><executions><execution><goals><goal>copy-dependencies</goal></goals><configuration><type>jar</type><includeTypes>jar</includeTypes><includeScope>runtime</includeScope><outputDirectory>${project.build.directory}/libs</outputDirectory></configuration></execution></executions></plugin></plugins></build><profiles><profile><id>bocloud.booter.tomcat</id><properties><bocloud.booter.version>****-LTS</bocloud.booter.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><groupId>org.hibernate.validator</groupId><artifactId>hibernate-validator</artifactId></exclusion></exclusions></dependency></dependencies></profile></profiles>
</project>

相关文章:

  • c#vb代码互转工具
  • SpringBoot+Vue校园管理系统(前后端分离)
  • MySQL分页:ROW_NUMBER() vs LIMIT
  • 【JMeter接口测试工具】第一节.JMeter简介和安装【入门篇】
  • vue 文件预览mp4、txt、pptx、xls、xlsx、docx、pdf、html、xml
  • SAP Build引言
  • AI绘画工具
  • 暑期来临,AI智能视频分析方案筑牢防溺水安全屏障
  • Linux `free` 命令:深入解析系统内存使用情况**
  • C语言 | Leetcode C语言题解之第136题只出现一次的数字
  • Nvidia/算能 +FPGA+AI大算力边缘计算盒子:桥梁结构安全监测
  • C++实现图像的模拟运动模糊
  • 探索AIGC时代:全球大模型产品的评估与未来展望
  • Vue进阶之Vue无代码可视化项目(三)
  • 【Linux】用户和组的管理、综合实训
  • ES6指北【2】—— 箭头函数
  • 《剑指offer》分解让复杂问题更简单
  • C学习-枚举(九)
  • Fundebug计费标准解释:事件数是如何定义的?
  • maven工程打包jar以及java jar命令的classpath使用
  • nodejs:开发并发布一个nodejs包
  • nodejs实现webservice问题总结
  • React-redux的原理以及使用
  • Twitter赢在开放,三年创造奇迹
  • Webpack 4 学习01(基础配置)
  • 从零开始在ubuntu上搭建node开发环境
  • 多线程 start 和 run 方法到底有什么区别?
  • 前端存储 - localStorage
  • 如何邀请好友注册您的网站(模拟百度网盘)
  • 使用parted解决大于2T的磁盘分区
  • 试着探索高并发下的系统架构面貌
  • 适配iPhoneX、iPhoneXs、iPhoneXs Max、iPhoneXr 屏幕尺寸及安全区域
  • 通信类
  • 微信公众号开发小记——5.python微信红包
  • 中国人寿如何基于容器搭建金融PaaS云平台
  • # SpringBoot 如何让指定的Bean先加载
  • #define 用法
  • #ifdef 的技巧用法
  • (M)unity2D敌人的创建、人物属性设置,遇敌掉血
  • (solr系列:一)使用tomcat部署solr服务
  • (阿里云万网)-域名注册购买实名流程
  • (二) Windows 下 Sublime Text 3 安装离线插件 Anaconda
  • (蓝桥杯每日一题)love
  • (一)UDP基本编程步骤
  • .NET的数据绑定
  • .NET面试题(二)
  • .pings勒索病毒的威胁:如何应对.pings勒索病毒的突袭?
  • @Pointcut 使用
  • @serverendpoint注解_SpringBoot 使用WebSocket打造在线聊天室(基于注解)
  • [100天算法】-不同路径 III(day 73)
  • [BUUCTF NewStarCTF 2023 公开赛道] week4 crypto/pwn
  • [BZOJ 3282] Tree 【LCT】
  • [BZOJ1877][SDOI2009]晨跑[最大流+费用流]
  • [C#]DataTable常用操作总结【转】
  • [Everyday Mathematics]20150130