开始学习http://maven.apache.org/guides/getting-started/index.html
這兩篇是必須要明白的
[b]understand build lifecycle[/b]
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[b]understand pom[/b]
http://maven.apache.org/pom.html
1. 如何配置和使用plugin
[b]plugin list[/b] http://maven.apache.org/plugins/
[b]configure plugin[/b] http://maven.apache.org/guides/mini/guide-configuring-plugins.html
[b]reference[/b]
https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html
2. 配置repository
下载:
local repository在user/.m2/repository 目录下。可以在下面建settings.xml 来引入多个repository. 这里引入的repository我猜是用来下载用的。
<repositories>
<repository>
<id>argus-build</id> <url>http://maven/nexus/content/groups/build</url>
<releases>
<checksumPolicy>fail</checksumPolicy>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
发布:
配置本地发布的repository信息,server下可配置包括svn等多种server的信息。
<servers>
<server>
<id>local-snapshot</id>
<username>z78918</username>
<password>*****</password>
</server>
<server>
<id>svn</id>
<username>z78918</username>
<password>Vision@11
</password>
</server>
</servers>
在pom里声明使用哪种server,
<distributionManagement>
<repository>
<id>local-release</id>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>local-snapshot</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
在build里声明dav和scp协议
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>1.0-beta-7</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-6</version>
</extension>
</extensions>
</build>
3. site
参考
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html
和maven 3.0公用的site-plugin,经过实验只有3.0-beta-1
配置如下
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-1</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
Appendix A
[b]Maven project descriptor[/b]
http://maven.apache.org/ref/3.0.3/maven-model/maven.html#class_DependencyManagement
[b]All the scope description[/b]
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
[b]FAQ[/b]
http://docs.codehaus.org/display/MAVENUSER/FAQs-1
這兩篇是必須要明白的
[b]understand build lifecycle[/b]
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[b]understand pom[/b]
http://maven.apache.org/pom.html
1. 如何配置和使用plugin
[b]plugin list[/b] http://maven.apache.org/plugins/
[b]configure plugin[/b] http://maven.apache.org/guides/mini/guide-configuring-plugins.html
[b]reference[/b]
https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html
2. 配置repository
下载:
local repository在user/.m2/repository 目录下。可以在下面建settings.xml 来引入多个repository. 这里引入的repository我猜是用来下载用的。
<repositories>
<repository>
<id>argus-build</id> <url>http://maven/nexus/content/groups/build</url>
<releases>
<checksumPolicy>fail</checksumPolicy>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
发布:
配置本地发布的repository信息,server下可配置包括svn等多种server的信息。
<servers>
<server>
<id>local-snapshot</id>
<username>z78918</username>
<password>*****</password>
</server>
<server>
<id>svn</id>
<username>z78918</username>
<password>Vision@11
</password>
</server>
</servers>
在pom里声明使用哪种server,
<distributionManagement>
<repository>
<id>local-release</id>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>local-snapshot</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
在build里声明dav和scp协议
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>1.0-beta-7</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-6</version>
</extension>
</extensions>
</build>
3. site
参考
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html
和maven 3.0公用的site-plugin,经过实验只有3.0-beta-1
配置如下
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-1</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
Appendix A
[b]Maven project descriptor[/b]
http://maven.apache.org/ref/3.0.3/maven-model/maven.html#class_DependencyManagement
[b]All the scope description[/b]
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
[b]FAQ[/b]
http://docs.codehaus.org/display/MAVENUSER/FAQs-1