Maven配置之pom.xml(二)

更多的项目信息

  • name:项目除了artifactId外,可以定义多个名称
  • description: 项目描述
  • url: 项目url
  • inceptionYear:创始年份

Licenses

xml 代码
 
  1. <licenses> 
  2.   <license> 
  3.     <name>Apache 2<!---->name> 
  4.     <url>http://www.apache.org/licenses/LICENSE-2.0.txt<!---->url> 
  5.     <distribution>repo<!---->distribution> 
  6.     <comments>A business-friendly OSS license<!---->comments> 
  7.   <!---->license> 
  8. <!---->licenses> 

Organization 配置组织信息

xml 代码
 
  1. <organization> 
  2.     <name>Codehaus Mojo<!---->name> 
  3.     <url>http://mojo.codehaus.org<!---->url> 
  4.   <!---->organization> 

Developers 配置开发者信息

xml 代码
 
  1. <developers> 
  2.     <developer> 
  3.       <id>eric<!---->id> 
  4.       <name>Eric<!---->name> 
  5.       <email>eredmond@codehaus.org<!---->email> 
  6.       <url>http://eric.propellors.net<!---->url> 
  7.       <organization>Codehaus<!---->organization> 
  8.       <organizationUrl>http://mojo.codehaus.org<!---->organizationUrl> 
  9.       <roles> 
  10.         <role>architect<!---->role> 
  11.         <role>developer<!---->role> 
  12.       <!---->roles> 
  13.       <timezone>-6<!---->timezone> 
  14.       <properties> 
  15.         <picUrl>http://tinyurl.com/prv4t<!---->picUrl> 
  16.       <!---->properties> 
  17.     <!---->developer> 
  18.   <!---->developers> 

Contributors

xml 代码
 
  1. <contributors> 
  2.    <contributor> 
  3.      <name>Noelle<!---->name> 
  4.      <email>some.name@gmail.com<!---->email> 
  5.      <url>http://noellemarie.com<!---->url> 
  6.      <organization>Noelle Marie<!---->organization> 
  7.      <organizationUrl>http://noellemarie.com<!---->organizationUrl> 
  8.      <roles> 
  9.        <role>tester<!---->role> 
  10.      <!---->roles> 
  11.      <timezone>-5<!---->timezone> 
  12.      <properties> 
  13.        <gtalk>some.name@gmail.com<!---->gtalk> 
  14.      <!---->properties> 
  15.    <!---->contributor> 
  16. <!---->contributors> 

环境设置
Issue Management     定义相关的bug跟踪系统,如bugzilla,testtrack,clearQuest等

xml 代码
 
  1. <issueManagement> 
  2.     <system>Bugzilla<!---->system> 
  3.     <url>http://127.0.0.1/bugzilla<!---->url> 
  4.   <!---->issueManagement> 

Continuous Integration Management 连续整合管理,基于triggers或者timings

xml 代码
 
  1. <ciManagement> 
  2.    <system>continuum<!---->system> 
  3.    <url>http://127.0.0.1:8080/continuum<!---->url> 
  4.    <notifiers> 
  5.      <notifier> 
  6.        <type>mail<!---->type> 
  7.        <sendOnError>true<!---->sendOnError> 
  8.        <sendOnFailure>true<!---->sendOnFailure> 
  9.        <sendOnSuccess>false<!---->sendOnSuccess> 
  10.        <sendOnWarning>false<!---->sendOnWarning> 
  11.        <configuration><address>continuum@127.0.0.1<!---->address><!---->configuration> 
  12.      <!---->notifier> 
  13.    <!---->notifiers> 
  14. <!---->ciManagement> 

Mailing Lists

xml 代码
 
  1. <mailingLists> 
  2.    <mailingList> 
  3.      <name>User List<!---->name> 
  4.      <subscribe>user-subscribe@127.0.0.1<!---->subscribe> 
  5.      <unsubscribe>user-unsubscribe@127.0.0.1<!---->unsubscribe> 
  6.      <post>user@127.0.0.1<!---->post> 
  7.      <archive>http://127.0.0.1/user/<!---->archive> 
  8.      <otherArchives> 
  9.        <otherArchive>http://base.google.com/base/1/127.0.0.1<!---->otherArchive> 
  10.      <!---->otherArchives> 
  11.    <!---->mailingList> 
  12. <!---->mailingLists> 

SCM   软件配置管理,如cvs 和svn

xml 代码
 
  1. <scm> 
  2.     <connection>scm:svn:http://127.0.0.1/svn/my-project<!---->connection> 
  3.     <developerConnection>scm:svn:https://127.0.0.1/svn/my-project<!---->developerConnection> 
  4.     <tag>HEAD<!---->tag> 
  5.     <url>http://127.0.0.1/websvn/my-project<!---->url> 
  6.   <!---->scm> 

Repositories
配置同setting.xml中的开发库
Plugin Repositories 配置同 repositories
Distribution Management 用于配置分发管理,配置相应的产品发布信息,主要用于发布,在执行mvn deploy后表示要发布的位置 1 配置到文件系统

xml 代码
 
  1. <distributionManagement> 
  2. <repository> 
  3. <id>proficio-repository<!---->id> 
  4. <name>Proficio Repository<!---->name> 
  5. <url>file://${basedir}/target/deploy<!---->url> 
  6. <!---->repository> 
  7. <!---->distributionManagement> 

2 使用ssh2配置

xml 代码
 
  1. <distributionManagement> 
  2. <repository> 
  3. <id>proficio-repository<!---->id> 
  4. <name>Proficio Repository<!---->name> 
  5. <url>scp://sshserver.yourcompany.com/deploy<!---->url> 
  6. <!---->repository> 
  7. <!---->distributionManagement> 

3 使用sftp配置

xml 代码
 
  1. <distributionManagement> 
  2. <repository> 
  3. <id>proficio-repository<!---->id> 
  4. <name>Proficio Repository<!---->name> 
  5. <url>sftp://ftpserver.yourcompany.com/deploy<!---->url> 
  6. <!---->repository> 
  7. <!---->distributionManagement> 

4 使用外在的ssh配置     编译扩展用于指定使用wagon外在ssh提供,用于提供你的文件到相应的远程服务器。

xml 代码
 
  1. <distributionManagement> 
  2. <repository> 
  3. <id>proficio-repository<!---->id> 
  4. <name>Proficio Repository<!---->name> 
  5. <url>scpexe://sshserver.yourcompany.com/deploy<!---->url> 
  6. <!---->repository> 
  7. <!---->distributionManagement> 
  8. <build> 
  9. <extensions> 
  10. <extension> 
  11. <groupId>org.apache.maven.wagon<!---->groupId> 
  12. <artifactId>wagon-ssh-external<!---->artifactId> 
  13. <version>1.0-alpha-6<!---->version> 
  14. <!---->extension> 
  15. <!---->extensions> 
  16. <!---->build> 

5 使用ftp配置

xml 代码
 
  1. <distributionManagement> 
  2. <repository> 
  3. <id>proficio-repository<!---->id> 
  4. <name>Proficio Repository<!---->name> 
  5. <url>ftp://ftpserver.yourcompany.com/deploy<!---->url> 
  6. <!---->repository> 
  7. <!---->distributionManagement> 
  8. <build> 
  9. <extensions> 
  10. <extension> 
  11. <groupId>org.apache.maven.wagon<!---->groupId> 
  12. <artifactId>wagon-ftp<!---->artifactId> 
  13. <version>1.0-alpha-6<!---->version> 
  14. <!---->extension> 
  15. <!---->extensions> 
  16. <!---->build> 

repository 对应于你的开发库,用户信息通过settings.xml中的server取得
Profiles 类似于settings.xml中的profiles,增加了几个元素,如下的样式:

xml 代码
 
  1. <profiles> 
  2.     <profile> 
  3.       <id>test<!---->id> 
  4.       <activation>...<!---->activation> 
  5.       <build>...<!---->build> 
  6.       <modules>...<!---->modules> 
  7.       <repositories>...<!---->repositories> 
  8.       <pluginRepositories>...<!---->pluginRepositories> 
  9.       <dependencies>...<!---->dependencies> 
  10.       <reporting>...<!---->reporting> 
  11.       <dependencyManagement>...<!---->dependencyManagement> 
  12.       <distributionManagement>...<!---->distributionManagement> 
  13.     <!---->profile> 
  14.   <!---->profiles> 
原文地址:https://www.cnblogs.com/forestwolf/p/2985426.html