Coordinates
這個是你先前在OSSRH所申請的專案的路徑,也是將來大家載入這個專案時要輸入的內容<
groupId
>com.github.abola</
groupId
> <
artifactId
>crawler</
artifactId
> <
version
>1.0.0</
version
>
Project Information
這區是為你所上傳的專案,增加一些說明,設定的內容會顯示在公開的repository相關網站上<
name
>Crawler Pack</
name
> <
description
>This is a open project of Java. The project integrated Apache Commons-VFS and Jsoup. It can be grabbing data much easy.</
description
> <
url
>https://github.com/abola/CrawlerPack</
url
>
- <name> 專案名稱
- <description> 專案描述
- <url> 專案網址
![]() |
本段的設定顯示在 http://mvnrepository.com/ 的比照 |
SCM
這段是設定你的原始碼版本控制資訊,如果是託管在Github上,就可參考以下設定
<
scm
> <
connection
>scm:git:git@github.com:
abola
/
CrawlerPack
.git</
connectio
> <
developerConnection
>scm:git:git@github.com:
abola
/
CrawlerPack
.git</
developerConnection
> <
url
>git@github.com:
abola
/
CrawlerPack
.git</
url
> </
scm
>
上方設定,對照你的github網址,顏色對應如下
https://github.com/abola/CrawlerPack
License
設定你的專案授權,比較常見的有Apache 2.0或是MIT,請依需求擇選一種Apache License 2.0
<
licenses
> <
license
> <
name
>Apache License, Version 2.0</
name
> <
url
>http://www.apache.org/licenses/LICENSE-2.0.txt</
url
> </
license
> </
licenses
>
MIT License
<
licenses
> <
license
> <
name
>MIT License</
name
> <
url
>http://www.opensource.org/licenses/mit-license.php</
url
> </
license
> </
licenses
>
Developer Information
專案開發者資訊
<
developers
> <
developer
> <
name
>Abola Lee</
name
> <
>abola921@gmail.com</
> </
developer
> </
developers
>
Project Dependencies
這些是你的專案會需要那些其它的package<
dependencies
> <
dependency
> <
groupId
>org.apache.commons</
groupId
> <
artifactId
>commons-vfs2</
artifactId
> <
version
>2.0</
version
> </
dependency
> ... </
dependencies
>
以上三項設定,你也可以在完成上傳後在 http://mvnrepository.com/ 看到結果
Build
這段我們一口氣要設定產生 javadoc / 打包 Surce / 為檔案產生簽章檔 / 上傳管理的套件,原則上你可以直接copy以下設定不需修改。<
build
> <
plugins
> <
plugin
> <
groupId
>org.sonatype.plugins</
groupId
> <
artifactId
>nexus-staging-maven-plugin</
artifactId
> <
version
>1.6.3</
version
> <
extensions
>true</
extensions
> <
configuration
> <
serverId
>ossrh</
serverId
> <
nexusUrl
>https://oss.sonatype.org/</
nexusUrl
> <
autoReleaseAfterClose
>true</
autoReleaseAfterClose
> </
configuration
> </
plugin
> <
plugin
> <
groupId
>org.apache.maven.plugins</
groupId
> <
artifactId
>maven-gpg-plugin</
artifactId
> <
executions
> <
execution
> <
id
>sign-artifacts</
id
> <
phase
>verify</
phase
> <
goals
> <
goal
>sign</
goal
> </
goals
> </
execution
> </
executions
> </
plugin
> <
plugin
> <
groupId
>org.apache.maven.plugins</
groupId
> <
artifactId
>maven-source-plugin</
artifactId
> <
executions
> <
execution
> <
id
>attach-sources</
id
> <
goals
> <
goal
>jar-no-fork</
goal
> </
goals
> </
execution
> </
executions
> </
plugin
> <
plugin
> <
groupId
>org.apache.maven.plugins</
groupId
> <
artifactId
>maven-javadoc-plugin</
artifactId
> <
executions
> <
execution
> <
id
>attach-javadocs</
id
> <
goals
> <
goal
>jar</
goal
> </
goals
> </
execution
> </
executions
> </
plugin
> </
plugins
> </
build
>
整段完整的 pom.xml 你可以參考爬蟲包專案的原始碼如下
https://github.com/abola/CrawlerPack/blob/master/pom.xml
沒有留言:
張貼留言