maven使用自己資料
maven.apache.org/guides/getting-started/index.html#What_is_Maven
新建JAVA普通專案:
mvn archetype:create \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DgroupId=com.mycompany.app \
-DartifactId=my-app
新建WTP web專案:
mvn archetype:create \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DarchetypeArtifactId=maven-archetype-webapp \ -DgroupId=com.mycompany.app \ -DartifactId=my-webapp
下面是對pom.xml檔案裡面的標籤進行講解:
project This is the top-level element in all Maven pom.xml files. modelVersion This element indicates what version of the object model this POM is using. The version of the model itself changes very infrequently but it is mandatory in order to ensure stability of use if and when the Maven developers deem it necessary to change the model. groupId This element indicates the unique identifier of the organization or group that created the project. The groupId is one of the key identifiers of a project and is typically based on the fully qualified domain name of your organization. For example org.apache.maven.plugins is the designated groupId for all Maven plug-ins. artifactId This element indicates the unique base name of the primary artifact being generated by this project. The primary artifact for a project is typically a JAR file. Secondary artifacts like source bundles also use the artifactId as part of their final name. A typical artifact produced by Maven would have the form <artifactid></artifactid>-<version></version>.<extension></extension> (for example, myapp-1.0.jar ). packaging This element indicates the package type to be used by this artifact (e.g. JAR, WAR, EAR, etc.). This not only means if the artifact produced is JAR, WAR, or EAR but can also indicate a specific lifecycle to use as part of the build process. (The lifecycle is a topic we will deal with further on in the guide. For now, just keep in mind that the indicated packaging of a project can play a part in customizing the build lifecycle.) The default value for the packaging element is JAR so you do not have to specify this for most projects. version This element indicates the version of the artifact generated by the project. Maven goes a long way to help you with version management and you will often see the SNAPSHOT designator in a version, which indicates that a project is in a state of development. We will discuss the use of snapshots and how they work further on in this guide. name This element indicates the display name used for the project. This is often used in Maven's generated documentation. url This element indicates where the project's site can be found. This is often used in Maven's generated documentation. description This element provides a basic description of your project. This is often used in Maven's generated documentation.以下maven自已的命令格式:
mvn compile
mvn test
mvn test-compile ( simply want to compile your test sources )
mvn clean test-compile
mvn install
mvn clean install
mvn clean
mvn install(可將你的專案打包成jar檔案放到你的.m2/repo下面了)
mvn package
mvn site
mvn resources:resources
mvn idea:idea
mvn eclipse:eclipse
mvn eclipse:clean
mvn process-resources
mvn process-resources "-Dcommand.line.prop=hello again"
# application.properties
java.version=${java.version}
command.line.prop=${command.line.prop}
# application.properties
application.name=${pom.name}
application.version=${pom.version}
<build></build>
<resources></resources>
<resource></resource>
<directory></directory>src/main/resources
<filtering></filtering>true
mvn deploy
- [...]
- <distributionManagement>
- <repository>
- <id>proficio-repositoryid>
- <name>Proficio Repositoryname>
- <url>file://${basedir}/target/deployurl>
- repository>
- distributionManagement>
- [...]
指定編譯後目錄:
- <build>
- <directory>${basedir}/targetdirectory>
- build>
For this example, we will configure the Java compiler to allow JDK 5.0 sources. This is as simple as adding this to your POM:
... |
dependencies
dependency這行依賴
http://www.devzuz.com/web/guest/downloads
相關文章
- 使用github搭建自己的maven庫GithubMaven
- 使用Maven配置JBoss、Wildfly資料來源Maven
- 使用Map將資料變成自己想要的
- 使用labelme標記自己的資料jsonJSON
- Maven 使用Maven
- IDEA如何配置自己的maven和maven設定阿里雲倉庫IdeaMaven阿里
- maven assembly plugin,maven dependency plugin的使用MavenPlugin
- 關於使用maven打包如何聚合資原始檔Maven
- maven使用筆記Maven筆記
- Maven高階使用Maven
- 在caffe上跑自己的資料
- 如何藉助GitHub搭建屬於自己的maven倉庫GithubMaven
- 釋出自己的jar到Maven Repository公服上JARMaven
- 如何在 GPU 深度學習雲服務裡,使用自己的資料集?GPU深度學習
- Windows10 使用 Tensorflow Object_detection API 訓練自己的資料WindowsObjectAPI
- 使用 Github 搭建 maven 私服GithubMaven
- 使用Maven配置SpringMavenSpring
- 使用Maven打包你的應用——maven-jar-plugin & maven-assembly-plugin & maven-shade-pluginMavenJARPlugin
- Maven基礎:Maven環境搭建及基本使用(1)Maven
- 自己收集的部分Angular學習資料Angular
- yolov3訓練自己資料教程YOLO
- 將自己的開源專案釋出到 Maven 中央倉庫Maven
- 建立你自己的本地倉庫(Maven倉庫管理-Nexus)Maven
- maven 學習總結(三)——使用Maven構建專案Maven
- maven 學習總結(九)——使用Nexus搭建Maven私服Maven
- maven中profiles使用詳解Maven
- 使用Maven整合SSH總結Maven
- Maven經典使用指南Maven
- Maven使用常用命令Maven
- maven 修改使用jdk版本MavenJDK
- 自己動手寫Android資料庫框架Android資料庫框架
- 怎樣快速搜尋自己所需的資料?
- 自己動手寫DB資料庫框架(增)資料庫框架
- Android資料自己主動更新庫DataAutoRefreshAndroid
- 資料庫日誌減肥。自己試過可以資料庫
- Java 資料大放送(自己總結的)Java
- maven 使用maven profile實現多環境可移植構建Maven
- 使用python抓取婚戀網使用者資料並用決策樹生成自己擇偶觀Python