1. 程式人生 > >pom.xml中各個標籤的意思

pom.xml中各個標籤的意思

Maven 構件工程的屬性檔案

pom.xml檔案(實踐用):

<project xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <!-- groupId: groupId:專案或者組織的唯一標誌,並且配置時生成的路徑也是由此生成,
       如com.mycompany.app生成的相對路徑為:/com/mycompany/app -->
   <groupId>asia.banseon</groupId>
   <!-- artifactId: 專案的通用名稱 -->
   <artifactId>banseon-maven2</artifactId>
   <!-- packaging: 打包的機制,如pom, jar, maven-plugin, ejb, war, ear, rar, par   -->
   <packaging>jar</packaging>
   <!-- version:專案的版本 -->
   <version>1.0-SNAPSHOT</version>
   <!-- 專案的名稱, Maven 產生的文件用 -->
   <name>banseon-maven</name>
   <!-- 哪個網站可以找到這個專案,提示如果 Maven 資源列表沒有,可以直接上該網站尋找, Maven 產生的文件用 -->
   <url>http://www.baidu.com/banseon</url>
   <!-- 專案的描述, Maven 產生的文件用 -->
   <description>A maven project to study maven.</description>
   <!-- 開發者資訊 -->
   <developers>
       <developer>
           <id>HELLO WORLD</id>
           <name>banseon</name>
           <email>
[email protected]
</email> <roles> <role>Project Manager</role> <role>Architect</role> </roles> <organization>demo</organization> <organizationUrl>http://hi.baidu.com/banseon</organizationUrl> <properties> <dept>No</dept> </properties> <timezone>-5</timezone> </developer> </developers> <!-- 類似 developers --> <contributors></contributors> <!-- 本專案相關 mail list, 用於訂閱等資訊 --> <mailingLists> <mailingList> <name>Demo</name> <!-- Link mail --> <post>
[email protected]
</post> <!-- mail for subscribe the project --> <subscribe>[email protected]</subscribe> <!-- mail for unsubscribe the project --> <unsubscribe>[email protected]</unsubscribe> <archive> http:/hi.baidu.com/banseon/demo/dev/ </archive> </mailingList> </mailingLists> <!-- 專案的問題管理系統(Bugzilla, Jira, Scarab,或任何你喜歡的問題管理系統)的名稱和URL,本例為 jira --> <issueManagement> <system>jira</system> <url>http://jira.baidu.com/banseon</url> </issueManagement> <!-- organization information --> <organization> <name>demo</name> <url>http://www.baidu.com/banseon</url> </organization> <!-- License --> <licenses> <license> <name>Apache 2</name> <url>http://www.baidu.com/banseon/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> <!-- - scm(software configuration management)標籤允許你配置你的程式碼庫,為Maven web站點和其它外掛使用。 - 如果你正在使用CVS或Subversion,source repository頁面同樣能給如何使用程式碼庫的詳細的、工具相關的指令。 - 下面是一個典型SCM的配置例子 --> <scm> <!-- 專案在 svn 上對應的資源 --> <connection> scm:svn:http://svn.baidu.com/banseon/maven/banseon/banseon-maven2-trunk(dao-trunk) </connection> <developerConnection> scm:svn:http://svn.baidu.com/banseon/maven/banseon/dao-trunk </developerConnection> <url>http://svn.baidu.com/banseon</url> </scm> <!-- 用於配置分發管理,配置相應的產品釋出資訊,主要用於釋出,在執行mvn deploy後表示要釋出的位置 --> <distributionManagement> <!-- 配置到檔案系統 --> <repository> <id>banseon-maven2</id> <name>banseon maven2</name> <url>file://${basedir}/target/deploy</url> </repository> <!-- 使用ssh2配置 --> <snapshotRepository> <id>banseon-maven2</id> <name>Banseon-maven2 Snapshot Repository</name> <url>scp://svn.baidu.com/banseon:/usr/local/maven-snapshot</url> </snapshotRepository> <!-- 使用ssh2配置 --> <site> <id>banseon-site</id> <name>business api website</name> <url> scp://svn.baidu.com/banseon:/var/www/localhost/banseon-web </url> </site> </distributionManagement> <!-- 依賴關係 --> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <!-- scope 說明 - compile :預設範圍,用於編譯 - provided:類似於編譯,但支援你期待jdk或者容器提供,類似於classpath - runtime: 在執行時,需要使用 - test: 用於test任務時使用 - system: 需要外在提供相應得元素。通過systemPath來取得 - systemPath: 僅用於範圍為system。提供相應的路徑 - optional: 標註可選,當專案自身也是依賴時。用於連續依賴時使用 --> <scope>test</scope> <!-- - systemPath: 僅用於範圍為system。提供相應的路徑 - optional: 標註可選,當專案自身也是依賴時。用於連續依賴時使用 --> <!-- <type>jar</type> <optional>true</optional> --> </dependency> <!-- - 外在告訴maven你只包括指定的專案,不包括相關的依賴。此因素主要用於解決版本衝突問題 - 如下依賴表示 專案acegi-security依賴 org.springframework.XXX 專案,但我們不需要引用這些專案 --> <dependency> <groupId>org.acegisecurity</groupId> <artifactId>acegi-security</artifactId> <version>1.0.5</version> <scope>runtime</scope> <exclusions> <exclusion> <artifactId>spring-core</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-support</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>commons-logging</artifactId> <groupId>commons-logging</groupId> </exclusion> <exclusion> <artifactId>spring-jdbc</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-remoting</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.1</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>2.5.1</version> <scope>runtime</scope> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.2-504.jdbc4</version> <scope>runtime</scope> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.6</version> <scope>runtime</scope> </dependency> </dependencies> <!-- - maven proxy, 本地倉庫,替代 maven.apache.org 網站 jar 列表,使用者下載時,首先尋找該站點 - 如資源找到,則下載。否則才去 jar 列表網站。對多人團隊,可節省下載速度和個人儲存空間。 --> <repositories> <repository> <id>banseon-repository-proxy</id> <name>banseon-repository-proxy</name> <url>http://192.168.1.169:9999/repository/</url> <layout>default</layout> </repository> </repositories> () 什麼是pom? pom作為專案物件模型。通過xml表示maven專案,使用pom.xml來實現。主要描述了專案:包括配置檔案;開發者需要遵循的規則,缺陷管理系統,組織和licenses,專案的url,專案的依賴性,以及其他所有的專案相關因素。 快速察看: xml 程式碼 <project> < modelVersion>4.0.0modelVersion> < groupId>...<groupId> < artifactId>...<artifactId> < version>...<version> < packaging>...<packaging> < 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包括了所有的專案資訊。 maven 相關: pom定義了最小的maven2元素,允許groupId,artifactId,version。所有需要的元素 groupId:專案或者組織的唯一標誌,並且配置時生成的路徑也是由此生成,如org.codehaus.mojo生成的相對路徑為:/org/codehaus/mojo artifactId: 專案的通用名稱 version:專案的版本 packaging: 打包的機制,如pom, jar, maven-plugin, ejb, war, ear, rar, par classifier: 分類 POM關係: 主要為依賴,繼承,合成 依賴關係: xml 程式碼 <dependencies> <dependency> <groupId>junit<groupId> <artifactId>junit<artifactId> <version>4.0<version> <type>ja<rtype> <scope>test<scope> <optional>true<optional> <dependency> ... < dependencies> groupId, artifactId, version:描述了依賴的專案唯一標誌 可以通過以下方式進行安裝: 使用以下的命令安裝: mvn install:install-file –Dfile=non-maven-proj.jar –DgroupId=some.group –DartifactId=non-maven-proj –Dversion=1 建立自己的庫,並配置,使用deploy:deploy-file 設定此依賴範圍為system,定義一個系統路徑。不提倡。 type:相應的依賴產品包形式,如jar,war scope:用於限制相應的依賴範圍,包括以下的幾種變數: compile :預設範圍,用於編譯 provided:類似於編譯,但支援你期待jdk或者容器提供,類似於classpath runtime:在執行時,需要使用 test:用於test任務時使用 system:需要外在提供相應得元素。通過systemPath來取得 systemPath: 僅用於範圍為system。提供相應的路徑 optional: 標註可選,當專案自身也是依賴時。用於連續依賴時使用 獨佔性 外在告訴maven你只包括指定的專案,不包括相關的依賴。此因素主要用於解決版本衝突問題 xml 程式碼 <dependencies> <dependency> <groupId>org.apache.maven<groupId> <artifactId>maven-embedder<artifactId> <version>2.0<version> <exclusions> <exclusion> <groupId>org.apache.maven<groupId> <artifactId>maven-core<artifactId> <exclusion> <exclusions> <dependency> < dependencies> 表示專案maven-embedder需要專案maven-core,但我們不想引用maven-core 繼承關係 另一個強大的變化,maven帶來的是專案繼承。主要的設定: 定義父專案 xml 程式碼 <project> < modelVersion>4.0.0<modelVersion> < groupId>org.codehaus.mojo<groupId> < artifactId>my-parent<artifactId> < version>2.0version> < packaging>pom<packaging> < project> packaging 型別,需要pom用於parent和合成多個專案。我們需要增加相應的值給父pom,用於子專案繼承。主要的元素如下: 依賴型 開發者和合作者 外掛列表 報表列表 外掛執行使用相應的匹配ids 外掛配置 子專案配置 xml 程式碼 <project> < modelVersion>4.0.0<modelVersion> < parent> <groupId>org.codehaus.mojo<groupId> <artifactId>my-parent<artifactId> <version>2.0<version> <relativePath>../my-parent<relativePath> < parent> < artifactId>my-project<artifactId> < project> relativePath可以不需要,但是用於指明parent的目錄,用於快速查詢。 dependencyManagement: 用於父專案配置共同的依賴關係,主要配置依賴包相同因素,如版本,scope。 合成(或者多個模組) 一個專案有多個模組,也叫做多重模組,或者合成專案。 如下的定義: xml 程式碼 <project> < modelVersion>4.0.0<modelVersion> < groupId>org.codehaus.mojo<groupId> < artifactId>my-parent<artifactId> < version>2.0<version> < modules> <module>my-project1<module> <module>my-project2<module> < modules> < project> build 設定 主要用於編譯設定,包括兩個主要的元素,build和report build 主要分為兩部分,基本元素和擴充套件元素集合 注意:包括專案build和profile build xml 程式碼 <project> <build>...<build> < profiles> <profile> <build>...<build> <profile> < profiles> < project> 基本元素 xml 程式碼 <build> < defaultGoal>install<defaultGoal> < directory>${basedir}/targetdirectory> < finalName>${artifactId}-${version}finalName> < filters> <filter>filters/filter1.properties<filter> < filters> ... < build> defaultGoal: 定義預設的目標或者階段。如install directory: 編譯輸出的目錄 finalName: 生成最後的檔案的樣式 filter: 定義過濾,用於替換相應的屬性檔案,使用maven定義的屬性。設定所有placehold的值 資源(resources) 你專案中需要指定的資源。如spring配置檔案,log4j.properties xml 程式碼 <project> < build> ... <resources> <resource> <targetPath>META-INF/plexus<targetPath> <filtering>falsefiltering> <directory>${basedir}/src/main/plexus<directory> <includes> <include>configuration.xml<include> <includes> <excludes> <exclude>**/*.properties<exclude> <excludes> <resource> <resources> <testResources> ... <testResources> ... < build> < project> resources: resource的列表,用於包括所有的資源 targetPath: 指定目標路徑,用於放置資源,用於build filtering: 是否替換資源中的屬性placehold directory: 資源所在的位置 includes: 樣式,包括那些資源 excludes: 排除的資源 testResources: 測試資源列表 外掛 在build時,執行的外掛,比較有用的部分,如使用jdk 5.0編譯等等 xml 程式碼 <project> < build> ... <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> <plugins> < build> < project> extensions: true or false,是否裝載外掛擴充套件。預設false inherited: true or false,是否此外掛配置將會應用於poms,那些繼承於此的專案 configuration: 指定外掛配置 dependencies: 外掛需要依賴的包 executions: 用於配置execution目標,一個外掛可以有多個目標。 如下: xml 程式碼 <plugin> <artifactId>maven-antrun-plugin<artifactId> <executions> <execution> <id>echodirid> <goals> <goal>run<goal> <phase>verify<phase> <inherited>false<inherited> <configuration> <tasks> <echo>Build Dir: ${project.build.directory}<echo> <tasks> <configuration> <execution> <executions> <plugin> 說明: id:規定execution 的唯一標誌 goals: 表示目標 phase: 表示階段,目標將會在什麼階段執行 inherited: 和上面的元素一樣,設定false maven將會拒絕執行繼承給子外掛 configuration: 表示此執行的配置屬性 外掛管理 pluginManagement:外掛管理以同樣的方式包括外掛元素,用於在特定的專案中配置。所有繼承於此專案的子專案都能使用。主要定義外掛的共同元素 擴充套件元素集合 主要包括以下的元素: Directories 用於設定各種目錄結構,如下: xml 程式碼 <build> <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> ... < build> Extensions 表示需要擴充套件的外掛,必須包括進相應的build路徑。 xml 程式碼 <project> < build> ... <extensions> <extension> <groupId>org.apache.maven.wagon<groupId> <artifactId>wagon-ftp<artifactId> <version>1.0-alpha-3<version> <extension> <extensions> ... < build> < project> Reporting 用於在site階段輸出報表。特定的maven 外掛能輸出相應的定製和配置報表。 xml 程式碼 <reporting> <plugins> <plugin> <outputDirectory>${basedir}/target/siteoutputDirectory> <artifactId>maven-project-info-reports-pluginartifactId> <reportSets> <reportSet>reportSet> reportSets> plugin> plugins> reporting> Report Sets 用於配置不同的目標,應用於不同的報表 xml 程式碼 <reporting> <plugins> <plugin> ... <reportSets> <reportSet> <id>sunlinkid> <reports> <report>javadoc<report> <inherited>truei<nherited> <configuration> <links> <link>http://java.sun.com/j2se/1.5.0/docs/api/<link> <configuration> <reportSet> <reportSets> <plugin> <plugins> < reporting> name:專案除了artifactId外,可以定義多個名稱 description: 專案描述 url: 專案url inceptionYear:創始年份 Licenses xml 程式碼 <licenses> < license> <name>Apache 2name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt<url> <distribution>repodistribution> <comments>A business-friendly OSS license<comments> < license> < licenses> Organization 配置組織資訊 xml 程式碼 <organization> <name>Codehaus Mojoname> <url>http://mojo.codehaus.org<url> organization> Developers 配置開發者資訊 xml 程式碼 <developers> <developer> <id>eric<id> <name>Eric<name> <email>
[email protected]
<email> <url>http://eric.propellors.net<url> <organization>Codehausorganization> <organizationUrl>http://mojo.codehaus.orgorganization<Url> <roles> <role>architect<role> <role>developer<role> <roles> <timezone>-6timezone> <properties> <picUrl>http://tinyurl.com/prv4tpic<Url> <properties> <developer> < developers> Contributors xml 程式碼 <contributors> <contributor> <name>Noelle<name> <email>[email protected]<email> <url>http://noellemarie.com<url> <organization>Noelle Marie<organization> <organizationUrl>http://noellemarie.com<organizationUrl> <roles> <role>tester<role> <roles> <timezone>-5<timezone> <properties> <gtalk>[email protected]<gtalk> <properties> <contributor> < contributors> 環境設定 Issue Management 定義相關的bug跟蹤系統,如bugzilla,testtrack,clearQuest等 xml 程式碼 <issueManagement> <system>Bugzilla<system> <url>http://127.0.0.1/bugzillau<rl> < issueManagement> Continuous Integration Management 連續整合管理,基於triggers或者timings xml 程式碼 <ciManagement> <system>continuum<system> <url>http://127.0.0.1:8080/continuum<url> <notifiers> <notifier> <type>mail<type> <sendOnError>true<sendOnError> <sendOnFailure>true<sendOnFailure> <sendOnSuccess>false<sendOnSuccess> <sendOnWarning>false<sendOnWarning> <configuration><address>[email protected]<address><configuration> <notifier> <notifiers> < ciManagement> Mailing Lists xml 程式碼 <mailingLists> <mailingList> <name>User List<name> <subscribe>[email protected]<subscribe> <unsubscribe>[email protected]<subscribe> <post>[email protected]<post> <archive>http://127.0.0.1/user/<archive> <otherArchives> <otherArchive>http://base.google.com/base/1/127.0.0.1<otherArchive> <otherArchives> <mailingList> < mailingLists> SCM 軟體配置管理,如cvs 和svn xml 程式碼 <scm> <connection>scm:svn:http://127.0.0.1/svn/my-project<connection> <developerConnection>scm:svn:https://127.0.0.1/svn/my-project<developerConnection> <tag>HEAD<tag> <url>http://127.0.0.1/websvn/my-project<url> < scm> Repositories 配置同setting.xml中的開發庫 Plugin Repositories 配置同 repositories Distribution Management 用於配置分發管理,配置相應的產品釋出資訊,主要用於釋出,在執行mvn deploy後表示要釋出的位置 配置到檔案系統 xml 程式碼 <distributionManagement> < repository> < id>proficio-repository<id> < name>Proficio Repository<name> < url>file://${basedir}/target/deploy<url> < repository> < distributionManagement> 使用ssh2配置 xml 程式碼 <distributionManagement> < repository> < id>proficio-repository<id> < name>Proficio Repository<name> < url>scp://sshserver.yourcompany.com/deploy<url> < repository> < distributionManagement> 使用sftp配置 xml 程式碼 <distributionManagement> < repository> < id>proficio-repositoryi<d> < name>Proficio Repository<name> < url>sftp://ftpserver.yourcompany.com/deploy<url> < repository> < distributionManagement> 使用外在的ssh配置 編譯擴充套件用於指定使用wagon外在ssh提供,用於提供你的檔案到相應的遠端伺服器。 xml 程式碼 <distributionManagement> < repository> < id>proficio-repository<id> < name>Proficio Repository<name> < url>scpexe://sshserver.yourcompany.com/deploy<url> < repository> < distributionManagement> < build> < extensions> < extension> < groupId>org.apache.maven.wagon<groupId> < artifactId>wagon-ssh-external<artifactId> < version>1.0-alpha-6<version> < extension> < extensions> < build> 使用ftp配置 xml 程式碼 <distributionManagement> < repository> < id>proficio-repository<id> < name>Proficio Repository<name> < url>ftp://ftpserver.yourcompany.com/deploy<url> < repository> < distributionManagement> < build> < extensions> < extension> < groupId>org.apache.maven.wagongroupId> < artifactId>wagon-ftpartifactId> < version>1.0-alpha-6version> < extension> < extensions> < build> repository 對應於你的開發庫,使用者資訊通過settings.xml中的server取得 Profiles 類似於settings.xml中的profiles,增加了幾個元素,如下的樣式: xml 程式碼 <profiles> <profile> <id>test<id> <activation>...<activation> <build>...<build> <modules>...<modules> <repositories>...<repositories> <pluginRepositories>...<pluginRepositories> <dependencies>...<dependencies> <reporting>...r<eporting> <dependencyManagement>...<dependencyManagement> <distributionManagement>...<distributionManagement> <profile> < profiles>

相關推薦

pom.xml各個標籤意思

Maven 構件工程的屬性檔案 pom.xml檔案(實踐用): <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins

pom.xmlbuild標籤

1.分類        (1)全域性配置(project build)                  針對整個專案的所有情況都有效        (2)配置(profile build)                  針對不同的profile配置 &

POM.XML的build標籤resources標籤

pom.xml中的兩種build 在Maven的pom.xml檔案中,存在如下兩種<build>: 說明: 一種<build>被稱為Project Build,即是<project>的直接子元素。另一種<build>被稱為Profile

使用 Versions Maven Plugin 來檢測pom.xml 使用的各個元件是否有新版本

在maven專案中使用  Versions Maven Plugin  支援 <dependency> <groupId>org.codehaus.mojo</g

struts.xml配置檔案各個標籤的含義,已經知識點記錄

struts.xml中使用<constant name="" value=""></constant>元素進行覆蓋<constant name="struts.devMode" value="true"></constant>這

在 eclipse 創建 web 版的 maven 工程以及 進一步了解 pom.xml scope 的相關配置設置問題

maven scope web 版的 maven 工程 pom.xml 1、在 eclipse中 創建 web 版的 maven 工程: a、和 創建 java 版的 maven 工程一樣,先選中一個簡單的工程(跳過經典模式),後填寫坐標(不了解的看先前的博文),在打包方式中選擇 war

[轉]關於maven pom.xmldependency type 為pom的應用

目的 art 導致 需要 是什麽 所有 sdn 也有 .net 原文地址:http://blog.csdn.net/yao123long/article/details/49925659 dependency為什麽會有type為pom,默認的值是什麽?dependency

pom.xml的dependencies點擊add怎麽沒有搜索到相關jar包

ext 文檔 操作 osi window ati code jar文件 相關 1、eclipse菜單 window-> show view –> other –> Maven2、在打開的窗口裏,右鍵 local repositories –> loc

pom.xml排除quartz包

quartz <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-all</artifactId> <version>1.4.0</

pom.xml添加Spring依賴

xsd -- -s ase uil nag move lean jar <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"

pom.xml使用distributionManagement將項目打包上傳到nexus私服

build 指定 mage 項目打包 admin hold set str eight 本文介紹 如何在pom.xml中使用distributionManagement將項目打包上傳到nexus私服1、pom.xml文件添加distributionManagement節點

pom.xml配置maven專案的JDK版本

預設版本 maven專案中,編譯器和JRE的版本預設為1.5(所以Alt + F5重新整理專案後,多個引數值會變成1.5) 引數如下(選中專案,Alt + Enter,檢視專案屬性): Java Build Path下的Libraries下的JRE System Lirbrary的版

maven 在pom.xml 指定倉庫位置

  ......  在pom.xml 中新增 倉庫位置(這樣遇到私服沒有的依賴,就會去這下載) </properties> <repositories><!-- 程式碼庫 --> <rep

mybatis配置檔案mapper.xmltrim標籤的用法

在mapper.xml中對statement的定義,可以用<trim>來填充和隱藏sql語句。 <!--修改user的statement--><update id="updateUser" parameterType="user">update user <

第14講 struts2struts.xml標籤配置

1複製專案,HeadFirstStruts2chapter02_06 改名:HeadFirstStruts2chapter02_07,同時修改web project settings 2修改HelloAction,name屬性,get() set()方法,package com.cruis

JEECG快速開發平臺入坑報錯解決第一波——pom.xmljeecg的依賴jar包沒匯入成功

不做多餘解釋,錯誤見上圖;jar包沒匯入成功,自然要想辦法匯入jar包,可選方法如下: 專案關閉,重新開啟,maven會自動下載; 選中專案,右鍵選擇RunAS,再選擇Maven install,控制檯會下載專案所依賴的包; 選中專案,右鍵選擇Maven,再選擇

pom.xml新增遠端倉庫

maven的pom.xml中新增遠端倉庫 <repositories> <repository>    <id>mvnrepository</id> <name>mvnrepository</name>

關於使用maven建立web專案pom.xml出現錯誤web.xml is missing and is set to true

錯誤提示: web.xml is missing and <failOnMissingWebXml> is set to true   意思就是,web專案需要一個web.xml檔案,而你通過maven的 建立是沒有web.xml,所以需要自己手動生成

如何把maven檔案pom.xml的java包下載下來

  右擊pom.xml檔案,選擇Run As--》Maven build…   在開啟的頁面中,如圖輸入“dependency:copy-dependencies”,後點擊“Run”即可   在當前專案的目錄的“targed/dependency

pom.xml使用“import”的scope來解決Maven專案單繼承問題

測試環境 maven 3.3.9 想必大家在做SpringBoot應用的時候,都會有如下程式碼: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring