maven项目中pom.xml一些属性记录
2017-03-10 11:30
288 查看
今天新建maven项目的时候顺便把其中一些点记录下来。
通过<groupId> <artifactId> <version>可以定位到唯一的项目,解决了名称冲突的问题。
<repositories>表示一组远程maven仓库的基本属性,因为在本地搭建了一个maven仓库所以需要将<url>标签值改掉,<releases>、<snapshots>这两个标签表示使用的jar包有稳定版与开发版之分,<enabled>标签为true表示我可以使用某种版本(稳定、开发)的版本
这个是插件仓库<pluginRepositories>,在项目中用到的插件所在的仓库,url就表示仓库的位置
这是使用其中的一个插件
接下来就是在maven中声明依赖了
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.8.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.9</version>
</dependency>
</dependencies>本篇就介绍到这里
通过<groupId> <artifactId> <version>可以定位到唯一的项目,解决了名称冲突的问题。
<repositories>表示一组远程maven仓库的基本属性,因为在本地搭建了一个maven仓库所以需要将<url>标签值改掉,<releases>、<snapshots>这两个标签表示使用的jar包有稳定版与开发版之分,<enabled>标签为true表示我可以使用某种版本(稳定、开发)的版本
<repositories> <repository> <id>nexus</id> <url>http://127.0.0.1:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
这个是插件仓库<pluginRepositories>,在项目中用到的插件所在的仓库,url就表示仓库的位置
<pluginRepositories> <pluginRepository> <id>nexus</id> <url>http://127.0.0.1:8081/nexus/content/groups/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories>
这是使用其中的一个插件
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>表示发布maven项目的时候发布到哪里
<distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
接下来就是在maven中声明依赖了
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.8.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.9</version>
</dependency>
</dependencies>本篇就介绍到这里
相关文章推荐
- maven项目pom.xml中的各属性的含义
- Maven项目中在xxx.xml ,xxx.properties 中为什么能使用 ${} 来引用pom文件中的属性
- 记录一下自己常用的maven工程的pom.xml模板
- 初做MAVEN项目 pom.xml报错
- 用eclipse创建maven项目pom.xml报错的解决办法
- Maven学习总结(十一)——Maven项目对象模型pom.xml文件详解
- 使用Maven来管理项目-pom.xml详细解读(三)
- maven项目报错--Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Qu
- springMVC+Mybatis的maven-web项目的pom.xml文件内容
- 使用assembly将maven项目pom.xml中的jar包打包
- eclipse中基于maven构建的web项目pom.xml中指定的jar包无法发布到tomcat中
- Maven学习总结(十一)——Maven项目对象模型pom.xml文件详解
- maven项目中自动下载jar包的pom.xml配置
- maven 项目 pom.xml报错
- Maven 的构建之 pom文件一些属性分析
- Maven项目管理实战(四)-pom.xml文件详解
- 大型Java项目中使用maven进行管理,pom.xml文件中build的配置
- MyEclipse建立spring-data-redis的Maven项目后pom.xml和Migration出错
- maven项目中自动下载jar包的pom.xml配置
- maven项目管理之-06-pom.xml说明