maven实战(04)_在pom中使用properties
2024-09-08 15:39:07
使用常量不仅让代码变得简洁,更重要的是可以避免重复,在需要更改的时候,只需要修改一处,降低了错误发生的概率。
通过<properties>元素用户可以自定义一个或多个Maven属性,然后在POM的其他地方使用 ${属性名}的方式来引用该属性。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycom.myapp</groupId>
<artifactId>myapp-util</artifactId>
<version>2.0.0-SNAPSHOT</version>
<name>util</name> <properties>
<springframework.version>4.1.2</springframework.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springframework.version}</version>
</dependency>
</dependencies>
</project>
最新文章
- spring注解源码分析--how does autowired works?
- CI框架源码阅读笔记2 一切的入口 index.php
- throw er; // Unhandled &#39;error&#39; event
- JAVA Io 缓冲输入输出流
- vs2010 C#链接 ACCESS数据库
- iOS Provisioning Profile(Certificate)与Code Signing详解
- Virtio:针对 Linux 的 I/O 虚拟化框架
- 配置普通用户可以运行saltstack的模块
- u-boot ctr0.S详解 包含_main函数
- HDU 5783 Divide the Sequence
- 解决虚拟机ssh连接出错connection refused
- highstock
- EXE转JPG后缀格式工具(真实JPG后缀)
- C# 中如何判断字符串的相似度
- Hadoop记录-HDFS配额Quota
- python -- 约束、异常处理、MD5
- 状态机学习(六)解析JSON2
- Arduino IDE for ESP8266 项目(2)wifi扫描
- 数据库连接池优化配置(druid,dbcp,c3p0)
- [Error] &#39;exit&#39; was not declared in this scope的解决方法
热门文章
- C# 提交网页请求时出现如下错误: System.Net.WebException: 操作超时
- Android开发之Activity横竖屏切换生命周期重建问题
- map 函数----filter函数
- Leetcode分类刷题答案&;心得
- LVS原理详解
- Error 1606 Could Not Access Network Location %SystemDrive%/inetpub/wwwroot/ 的错误解决方法
- 微信小程序-关于重定向问题
- XCode8 App上传AppStore更新
- BZOJ 2007: [Noi2010]海拔
- css-css权威指南学习笔记8