1. 程式人生 > >maven核心,pom.xml詳解

maven核心,pom.xml詳解

什麼是pom?
    pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。

快速察看:
<project>
  <modelVersion>4.0.0</modelVersion>
<!--maven2.0必須是這樣寫,現在是maven2唯一支援的版本-->
  <!-- 基礎設定 -->
  <groupId>...</groupId>
  <artifactId>...</artifactId>
  <version>...</version>
  <packaging>...</packaging>

  <name>...</name>

  <url>...</url>
  <dependencies>...</dependencies>
  <parent>...</parent>
  <dependencyManagement>...</dependencyManagement>
  <modules>...</modules>
  <properties>...</properties>

  <!--構建設定 -->
  <build>...</build>
  <reporting>...</reporting>

  <!-- 更多專案資訊 -->
  <name>...</name>
  <description>...</description>
  <url>...</url>
  <inceptionYear>...</inceptionYear>
  <licenses>...</licenses>
  <organization>...</organization>
  <developers>...</developers>
  <contributors>...</contributors>

  <!-- 環境設定-->
  <issueManagement>...</issueManagement>
  <ciManagement>...</ciManagement>
  <mailingLists>...</mailingLists> 
  <scm>...</scm>
  <prerequisites>...</prerequisites>
  <repositories>...</repositories>
  <pluginRepositories>...</pluginRepositories>
  <distributionManagement>...</distributionManagement>
  <profiles>...</profiles>
</project>

基本內容:

POM包括了所有的專案資訊

groupId:專案或者組織的唯一標誌,並且配置時生成路徑也是由此生成,如org.myproject.mojo生成的相對路徑為:/org/myproject/mojo

artifactId:專案的通用名稱

version:專案的版本

packaging:打包機制,如pom,jar,maven-plugin,ejb,war,ear,rar,par

name:使用者描述專案的名稱,無關緊要的東西,可選

url:應該是隻是寫明開發團隊的網站,無關緊要,可選

classifer:分類

其中groupId,artifactId,version,packaging這四項組成了專案的唯一座標。一般情況下,前面三項就可以組成專案的唯一座標了。

POM關係:主要為依賴,繼承,合成

依賴關係:

<dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.0</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>

    <dependency>

        <groupId>com.alibaba.china.shared</groupId>

        <artifactId>alibaba.apollo.webx</artifactId>

        <version>2.5.0</version>

        <exclusions>

          <exclusion>

            <artifactId>org.slf4j.slf4j-api</artifactId>

            <groupId>com.alibaba.external</groupId>

          </exclusion>

          ....

        </exclusions>

......

</dependencies>

其中groupId, artifactId, version這三個組合標示依賴的具體工程,而且 這個依賴工程必需是maven中心包管理範圍內的,如果碰上非開源包,maven支援不了這個包,那麼則有有三種 方法處理:

1.本地安裝這個外掛install plugin

例如:mvn install:intall-file -Dfile=non-maven-proj.jar -DgroupId=som.group -DartifactId=non-maven-proj -Dversion=1

2.建立自己的repositories並且部署這個包,使用類似上面的deploy:deploy-file命令,

3.設定scope為system,並且指定系統路徑。

dependency裡屬性介紹:

type:預設為jar型別,常用的型別有:jar,ejb-client,test-jar...,可設定plugins中的extensions值為true後在增加 新的型別,

scope:是用來指定當前包的依賴範圍,maven的依賴範圍

optional:設定指依賴是否可選,預設為false,即子專案預設都繼承,為true,則子專案必需顯示的引入,與dependencyManagement裡定義的依賴類似 。

exclusions:如果X需要A,A包含B依賴,那麼X可以宣告不要B依賴,只要在exclusions中宣告exclusion.

exclusion:是將B從依賴樹中刪除,如上配置,alibaba.apollo.webx不想使用com.alibaba.external  ,但是alibaba.apollo.webx是集成了com.alibaba.external,r所以就需要排除掉.

如果一個工程是parent或者aggregation(即mutil-module的)的,那麼必須在packing賦值為pom,child工程從parent繼承的包括:dependencies,developers,contributors,plugin lists,reports lists,plugin execution with matching ids,plugin configuration

parent的使用方法如下:

<parent>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>my-parent</artifactId>
    <version>2.0</version>
    <relativePath>../my-parent</relativePath>
  </parent>

relativePath是可選的,maven會首先搜尋這個地址,在搜尋本地遠端repositories之前.

dependencyManagement:是用於幫助管理chidren的dependencies的。例如如果parent使用dependencyManagement定義了一個dependencyon junit:junit4.0,那麼 它的children就可以只引用 groupId和artifactId,而version就可以通過parent來設定,這樣的好處就是可以集中管理 依賴的詳情

modules:對於多模組的project,outer-module沒有必需考慮inner-module的dependencies,當列出modules的時候,modules的順序是不重要的,因為maven會自動根據依賴關係來拓撲排序,

modules例子如下 :

<module>my-project</module>

<module>other-project</module>

properties:是為pom定義一些常量,在pom中的其它地方可以直接引用。

定義方式如下:

<properties>

      <file.encoding>UTF-8</file_encoding>

      <java.source.version>1.5</java_source_version>

      <java.target.version>1.5</java_target_version>

</properties>

使用方式 如下 :

${file.encoding}

還可以使用project.xx引用pom裡定義的其它屬性:如$(project.version} 

build設定:

defaultGoal:預設的目標,必須跟命令列上的引數相同,如:jar:jar,或者與時期parse相同,例如install

directory:指定build target目標的目錄,預設為$(basedir}/target,即專案根目錄下的target

finalName:指定去掉字尾的工程名字,例如:預設為${artifactId}-${version}

filters:用於定義指定filter屬性的位置,例如filter元素賦值filters/filter1.properties,那麼這個檔案裡面就可以定義name=value對,這個name=value對的值就可以在工程pom中通過${name}引用,預設的filter目錄是${basedir}/src/main/fiters/

resources:描述工程中資源的位置 

<resource>
        <targetPath>META-INF/plexus</targetPath>
        <filtering>false</filtering>
        <directory>${basedir}/src/main/plexus</directory>
        <includes>
          <include>configuration.xml</include>
        </includes>
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>
      </resource>

targetPath:指定build資源到哪個目錄,預設是base directory

filtering:指定是否將filter檔案(即上面說的filters裡定義的*.property檔案)的變數值在這個resource檔案有效,例如上面就指定那些變數值在configuration檔案無效。

directory:指定屬性檔案的目錄,build的過程需要找到它,並且將其放到targetPath下,預設的directory是${basedir}/src/main/resources

includes:指定包含檔案的patterns,符合樣式並且在directory目錄下的檔案將會包含進project的資原始檔。

excludes:指定不包含在內的patterns,如果inclues與excludes有衝突,那麼excludes勝利,那些符合衝突的樣式的檔案是不會包含進來的。

testResources:這個模組包含測試資源元素,其內容定義與resources類似,不同的一點是預設的測試資源路徑是${basedir}/src/test/resources,測試資源是不部署的。

plugins配置:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.0</version>
        <extensions>false</extensions>
        <inherited>true</inherited>
        <configuration>
          <classifier>test</classifier>
        </configuration>
        <dependencies>...</dependencies>
        <executions>...</executions>
      </plugin>

extensions:true or false, 決定是否要load這個plugin的extensions,預設為true.

inherited:是否讓子pom繼承,ture or false 預設為true.

configuration:通常用於私有不開源的plugin,不能夠詳細瞭解plugin的內部工作原理,但使plugin滿足的properties

dependencies:與pom基礎的dependencies的結構和功能都相同,只是plugin的dependencies用於plugin,而pom的denpendencies用於專案本身。在plugin的dependencies主要用於改變plugin原來的dependencies,例如排除一些用不到的dependency或者修改dependency的版本等,詳細請看pom的denpendencies.

executions:plugin也有很多個目標,每個目標具有不同的配置,executions就是設定plugin的目標,

<execution>
            <id>echodir</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>verify</phase>
            <inherited>false</inherited>
            <configuration>
              <tasks>
                <echo>Build Dir: ${project.build.directory}</echo>
              </tasks>
            </configuration>
          </execution> 

id:識別符號

goals:裡面列出一系列的goals元素,例如上面的run goal

phase:宣告goals執行的時期,例如:verify

inherited:是否傳遞execution到子pom裡。

configuration:設定execution下列表的goals的設定,而不是plugin所有的goals的設定

pluginManagement配置:

pluginManagement的作用類似於denpendencyManagement,只是denpendencyManagement是用於管理專案jar包依賴,pluginManagement是用於管理plugin。與pom build裡的plugins區別是,這裡的plugin是列出來,然後讓子pom來決定是否引用。

例如:

<pluginManagement> 

      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.2</version>
          <executions>
            <execution>
              <id>pre-process-classes</id>
              <phase>compile</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <classifier>pre-process</classifier>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
子pom引用方法:
在pom的build裡的plugins引用:
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
    </plugins>

build裡的directories:

<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
    <scriptSourceDirectory>${basedir}/src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
    <outputDirectory>${basedir}/target/classes</outputDirectory>
    <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>

這幾個元素只在parent build element裡面定義,他們設定多種路徑結構,他們並不在profile裡,所以不能通過profile來修改

build 裡面的Extensions
它們是一系列build過程中要使用的產品,他們會包含在running bulid‘s classpath裡面。他們可以開啟extensions,也可以通過提供條件來啟用plugins。簡單來講,extensions是在build過程被啟用的產品
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>1.0-alpha-3</version>
      </extension>
    </extensions> 

reporting設定:

reporting包含site生成階段的一些元素,某些maven plugin可以生成reports並且在reporting下配置。例如javadoc,maven site等,在reporting下配置的report plugin的方法與build幾乎一樣,最不同的是build的plugin goals在executions下設定,而reporting的configures goals在reporttest。

excludeDefaults:是否排除site generator預設產生的reports

outputDirectory,預設的dir變成:${basedir}/target/site

report sets:設定execution goals,相當於build裡面的executions,不同的是不能夠bind a report to another phase,只能夠是site

<reporting>
    <plugins>
      <plugin>
        ...
        <reportSets>
          <reportSet>
            <id>sunlink</id>
            <reports>
              <report>javadoc</report>
            </reports>
            <inherited>true</inherited>
            <configuration>
              <links>
                <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
              </links>
            </configuration>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
reporting裡面的厄reportSets和build裡面的executions的作用都是控制pom的不同粒度去控制build的過程,我們不單要配置plugins,還要配置那些plugins單獨的goals。

更多專案資訊:

name:專案除了artifactId外,可以定義多個名稱
description: 專案描述
url: 專案url
inceptionYear:創始年份

Licenses
<licenses>
  <license>
    <name>Apache 2</name>
    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
    <comments>A business-friendly OSS license</comments>
  </license>
</licenses>

列出本工程直接的licenses,而不要列出dependencies的licenses

配置組織資訊:
  <organization>
    <name>Codehaus Mojo</name>
    <url>http://mojo.codehaus.org</url>
  </organization>

很多工程都受到某些組織執行,這裡設定基本資訊

配置開發者資訊:

例如:一個開發者可以有多個roles,properties是 
<developers>
    <developer>
      <id>eric</id>
      <name>Eric</name>
      <email>[email protected]</email>
      <url>http://eric.propellors.net</url>
      <organization>Codehaus</organization>
      <organizationUrl>http://mojo.codehaus.org</organizationUrl>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>-6</timezone>
      <properties>
        <picUrl>http://tinyurl.com/prv4t</picUrl>
      </properties>
    </developer>
  </developers>

環境設定:

issueManagement:bug跟蹤管理系統,定義defect tracking system缺陷跟蹤系統,比如有(bugzilla,testtrack,clearquest等).

例如:

  <issueManagement> 
    <system>Bugzilla</system> 
    <url>http://127.0.0.1/bugzilla/</url> 
  </issueManagement> 

倉庫:

Repositories:pom裡面的倉庫與setting.xml裡的倉庫功能是一樣的。主要的區別在於,pom裡的倉庫是個性化的。比如一家大公司裡的setting檔案是公用 的,所有專案都用一個setting檔案,但各個子專案卻會引用不同的第三方庫,所以就需要在pom裡設定自己需要的倉庫地址。

repositories:要成為maven2的repository artifact,必須具有pom檔案在$BASE_REPO/groupId/artifactId/version/artifactId-version.pom 
BASE_REPO可以是本地,也可以是遠端的。repository元素就是宣告那些去查詢的repositories 
預設的central Maven repository在http://repo1.maven.org/maven2/

<repositories> 
    <repository> 
      <releases> 
        <enabled>false</enabled> 
        <updatePolicy>always</updatePolicy> 
        <checksumPolicy>warn</checksumPolicy> 
      </releases> 
      <snapshots> 
        <enabled>true</enabled> 
        <updatePolicy>never</updatePolicy> 
        <checksumPolicy>fail</checksumPolicy> 
      </snapshots> 
      <id>codehausSnapshots</id> 
      <name>Codehaus Snapshots</name> 
      <url>http://snapshots.maven.codehaus.org/maven2</url> 
      <layout>default</layout> 
    </repository> 
  </repositories> 

release和snapshots:是artifact的兩種policies,pom可以選擇那種政策有效。 
enable:本別指定兩種型別是否可用,true or false 
updatePolicy:說明更新發生的頻率always 或者 never 或者 daily(預設的)或者 interval:X(X是分鐘數) 

checksumPolicy:當Maven的部署檔案到倉庫中,它也部署了相應的校驗和檔案。您可以選擇忽略,失敗,或缺少或不正確的校驗和警告。

layout:maven1.x與maven2有不同的layout,所以可以宣告為default或者是legacy(遺留方式maven1.x)。

外掛倉庫:

pluginRepositories:與Repositories具有類似的結構,只是Repositories是dependencies的home,而這個是plugins 的home。

分發管理:

distributionManagement :管理distribution和supporting files。 

downloadUrl:是其他專案為了抓取本專案的pom’s artifact而指定的url,就是說告訴pom upload的地址也就是別人可以下載的地址。 
status:這裡的狀態不要受到我們的設定,maven會自動設定project的狀態,有效的值:none:沒有宣告狀態,pom預設的;converted:本project是管理員從原先的maven版本convert到maven2的;partner:以前叫做synched,意思是與partner repository已經進行了同步;deployed:至今為止最經常的狀態,意思是製品是從maven2 instance部署的,人工在命令列deploy的就會得到這個;verified:本製品已經經過驗證,也就是已經定下來了最終版。 
repository:宣告deploy過程中current project會如何變成repository,說明部署到repository的資訊。 
    <repository> 
      <uniqueVersion>false</uniqueVersion> 
      <id>corp1</id> 
      <name>Corporate Repository</name> 
      <url>scp://repo1/maven2</url> 
      <layout>default</layout> 
    </repository> 
    <snapshotRepository> 
      <uniqueVersion>true</uniqueVersion> 
      <id>propSnap</id> 
      <name>Propellors Snapshots</name> 
      <url>sftp://propellers.net/maven</url> 
      <layout>legacy</layout> 
    </snapshotRepository> 
id, name::唯一性的id,和可讀性的name 
uniqueVersion:指定是否產生一個唯一性的version number還是使用address裡的其中version部分。true or false 
url:說明location和transport protocol 
layout:default或者legacy

profiles:pom4.0的一個新特性就是具有根據environment來修改設定的能力

它包含可選的activation(profile的觸發器)和一系列的changes。例如test過程可能會指向不同的資料庫(相對最終的deployment)或者不同的dependencies或者不同的repositories,並且是根據不同的JDK來改變的。那麼結構如下: 

  <profiles> 
    <profile> 
      <id>test</id> 
      <activation>...</activation> 
      <build>...</build> 
      <modules>...</modules> 
      <repositories>...</repositories> 
      <pluginRepositories>...</pluginRepositories> 
      <dependencies>...</dependencies> 
      <reporting>...</reporting> 
      <dependencyManagement>...</dependencyManagement> 
      <distributionManagement>...</distributionManagement> 
    </profile> 
  </profiles> 
Activation: 
觸發這個profile的條件配置如下例:(只需要其中一個成立就可以啟用profile,如果第一個條件滿足了,那麼後面就不會在進行匹配。 
    <profile> 
      <id>test</id> 
      <activation> 
        <activeByDefault>false</activeByDefault> 
        <jdk>1.5</jdk> 
        <os> 
          <name>Windows XP</name> 
          <family>Windows</family> 
          <arch>x86</arch> 
          <version>5.1.2600</version> 
        </os> 
        <property> 
          <name>mavenVersion</name> 
          <value>2.0.3</value> 
        </property> 
        <file> 
          <exists>${basedir}/file2.properties</exists> 
          <missing>${basedir}/file1.properties</missing> 
        </file> 
      </activation> 

啟用profile的方法有多個:setting檔案的activeProfile元素明確指定啟用的profile的ID,在命令列上明確啟用Profile用-P flag 引數 
檢視某個build會啟用的profile列表可以用:mvn help:active-profiles 

相關推薦

maven核心pom.xml(轉)

  什麼是pom?     pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。

【轉】maven核心pom.xml

  感謝如下博主: maven核心,pom.xml詳解 什麼是pom?    pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案

maven核心pom.xml

什麼是pom?    pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。 快速察看:<pr

Maven實戰:Pom.xml

enable sub 導航欄 deployed home pid 系統類型 介紹 corporate 什麽是pom? pom作為項目對象模型。通過xml表示maven項目,使用pom.xml來實現。主要描述了項目:包括配置文件;開發者需要遵循的規則,缺陷管理系統,組織

Maven配置檔案pom.xml(轉)

什麼是POM? POM是專案物件模型(Project Object Model)的簡稱,它是Maven專案中的檔案,使用XML表示,名稱叫做pom.xml。在Maven中,當談到Project的時候,不僅僅是一堆包含程式碼的檔案。一個Project往往包含一個配置檔案,包括了與開發者有關的,缺陷

maven學習2——pom.xml

1.前言 Maven,發音是[`meivin],"專家"的意思。它是一個很好的專案管理工具,很早就進入了我的必備工具行列,但是這次為了把project1專案完全遷移並應用maven,所以對maven進行了一些深入的學習。寫這個學習筆記的目的,一個是為了自己備忘,二則希望能夠為其他人學習

Maven配置檔案pom.xml

什麼是POM? POM是專案物件模型(Project Object Model)的簡稱,它是Maven專案中的檔案,使用XML表示,名稱叫做pom.xml。在Maven中,當談到Project的時候,不僅僅是一堆包含程式碼的檔案。一個Project往往包含一個配置檔案,包

maven核心pom.xml檔案

什麼是pom?     pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。 快

SSM框架配合Mavenpom.xml配置

這篇部落格針對我這樣的小白。 一. pom.xml有什麼用?:  我們知道maven(什麼是maven請移步https://www.cnblogs.com/whgk/p/7112560.html) 可以給我們管理jar包和其他資源(jar包:別人寫好的輪子,我們負責呼叫)

Maven學習筆記(3)-MavenPOM.XML

目錄 一、介紹POM   Maven之前的構建工具有Make和Ant,其中Make依賴構建指令碼Makefile,Ant依賴構建指令碼build.xml。同理,Maven專案也依賴構建指令碼。   POM(Project Object Model

Eclipse中Maven的使用以及Pom.xml

Eclipse中建立Maven專案 一、Maven專案的建立 1. 點選File->New->Other->搜尋maven->選擇Maven Project點選Next: 2. 勾選第一項,表示跳過骨架選擇,點選Next:

Maven專案中的pom.xml

什麼是pom?    pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素 <project x

Mavenpom.xml文件報錯

3.0 idt util pom XML img 項目 一個 技術分享 一:錯誤消息,如下圖: aus 原因是本地倉庫在org.codehaus.plexus:plexus-uils:pom:3.0.20下面沒有jar文件,只有一個plexus-utils-3.0.20.p

Java Pom.xml

build class文件 想要 單元測試 校驗 組成 例如 ons 版本庫 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema

建立的maven專案pom.xml檔案報錯解決方法

eclipse建立的maven專案,pom.xml檔案報錯解決方法 【錯誤原因一:】maven 編譯級別過低 【解決辦法:】 使用 maven-compiler-plugin 將 maven 編譯級別改為 jdk1.6 以上: <!-- java編譯外掛

匯入他人的maven專案pom.xml標頭檔案報錯

編譯後提示如下錯誤 開啟maven-resources-plugin:3.0.1所在目錄,刪除,使用eclipse的選中專案的pom.xml - run as - maven install,重新下載。 D:\program\apache-maven-3.0.3\

什麼是pom.xml?有什麼作用?--pom.xml

什麼是POM? POM是專案物件模型(Project Object Model)的簡稱,它是Maven專案中的檔案,使用XML表示,名稱叫做pom.xml。作用類似ant的build.xml檔案,功能更強大。該檔案用於管理:原始碼、配置檔案、開發者的資訊和角色、問題追蹤系統

Eclipse建立Maven工程pom.xmldependency報錯的解決辦法

是否配置了maven環境 如果沒有,先配置maven環境 Mac配置maven環境 1⃣️ tar.gz archive:是在Linux、MacOsX上使用的。 2⃣️ zip arc

pom.xml

一、什麼是POM Project Object Model,專案物件模型。通過xml格式儲存的pom.xml檔案。作用類似ant的build.xml檔案,功能更強大。該檔案用於管理:原始碼、配置檔案、開發者的資訊和角色、問題追蹤系統、組織資訊、專案授權、專案的url、專案

Maven系列2--pom.xml 配置

<project xmlns="http://maven.apache.org/POM/4.0.0 "       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "       xsi:schemaLocat