2015-02-03 21 views
6

Trong một thời gian khá dài đang sử dụng công cụ quản lý phụ thuộc như Maven. Tôi không thể hiểu được sự cần thiết của thẻ url trong pom.xml dưới dự án thẻ.Thẻ "<url> http://maven.apache.org</url>" trong thẻ dự án trong tệp pom.xml là gì?

<project> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.mycompany.app</groupId> 
    <artifactId>my-app</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>Maven Quick Start Archetype</name> 
    <url>http://maven.apache.org</url> 

    <dependencies> 
    ... 
    </dependencies> 
</project> 
+0

http://maven.apache.org/ pom.html –

Trả lời

5

url cung cấp cho bạn thông tin về dự án, nơi dự án được lưu trữ

từ tài liệu (http://maven.apache.org/pom.html):

url: URL, giống như tên, không được yêu cầu . Đây là một cử chỉ tốt đẹp cho người dùng dự án, tuy nhiên, để họ biết nơi dự án lives.url: URL, giống như tên, không bắt buộc. Tuy nhiên, đây là một cử chỉ đẹp cho người dùng dự án, để họ biết được cuộc sống của dự án ở đâu.

Ví dụ

Joda thời gian:

https://github.com/JodaOrg/joda-time/blob/master/pom.xml

<packaging>jar</packaging> 
    <name>Joda-Time</name> 
    <version>2.8-SNAPSHOT</version> 
    <description>Date and time library to replace JDK date handling</description> 
    <url>http://www.joda.org/joda-time/</url> 

apache commons-lang: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?view=markup

<inceptionYear>2001</inceptionYear> 
    <description> 
    Apache Commons Lang, a package of Java utility classes for the 
    classes that are in java.lang's hierarchy, or are considered to be so 
    standard as to justify existence in java.lang. 
    </description> 
    <url>http://commons.apache.org/proper/commons-lang/</url> 
Các vấn đề liên quan