Computing Magazine

Create Your Own Maven Archetype

Posted on the 17 November 2015 by Skiabox @skiabox

Create your own maven archetype

[tabitem]


[/tabitem]

[tabitem]


[/tabitem]

[tabitem]


[/tabitem]

[tabitem]


[/tabitem]

[tabitem]


[/tabitem]

[tabitem]

[/tabitem]
[tabitem]

[/tabitem]
[tabitem]

[/tabitem]

mvn clean install

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------
[INFO] Building com.skiabox.app10 1.0-SNAPSHOT
[INFO] ------------------------
[INFO]
[INFO] - maven-clean-plugin:3.0.0:clean (default-clean) @ com.skiabox.app10 -
[INFO] Deleting /Users/Administrator/IdeaProjects/NextGenerationProject1/target
[INFO]
[INFO] - maven-resources-plugin:2.7:resources (default-resources) @ com.skiabox.app10 -
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/Administrator/IdeaProjects/NextGenerationProject1/src/main/resources
[INFO]
[INFO] - maven-compiler-plugin:3.3:compile (default-compile) @ com.skiabox.app10 -
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/Administrator/IdeaProjects/NextGenerationProject1/target/classes
[INFO]
[INFO] - maven-resources-plugin:2.7:testResources (default-testResources) @ com.skiabox.app10 -
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/Administrator/IdeaProjects/NextGenerationProject1/src/test/resources
[INFO]
[INFO] - maven-compiler-plugin:3.3:testCompile (default-testCompile) @ com.skiabox.app10 -
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/Administrator/IdeaProjects/NextGenerationProject1/target/test-classes
[INFO]
[INFO] - maven-surefire-plugin:2.19:test (default-test) @ com.skiabox.app10 -

-------------------
T E S T S
-------------------
Running com.skiabox.apps.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.skiabox.apps.AppTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] - maven-jar-plugin:2.6:jar (default-jar) @ com.skiabox.app10 -
[INFO] Building jar: /Users/Administrator/IdeaProjects/NextGenerationProject1/target/com.skiabox.app10-1.0-SNAPSHOT.jar
[INFO]
[INFO] - maven-install-plugin:2.5.2:install (default-install) @ com.skiabox.app10 -
[INFO] Installing /Users/Administrator/IdeaProjects/NextGenerationProject1/target/com.skiabox.app10-1.0-SNAPSHOT.jar to /Users/Administrator/.m2/repository/com/skiabox/apps/com.skiabox.app10/1.0-SNAPSHOT/com.skiabox.app10-1.0-SNAPSHOT.jar
[INFO] Installing /Users/Administrator/IdeaProjects/NextGenerationProject1/pom.xml to /Users/Administrator/.m2/repository/com/skiabox/apps/com.skiabox.app10/1.0-SNAPSHOT/com.skiabox.app10-1.0-SNAPSHOT.pom
[INFO] ------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------
[INFO] Total time: 4.567 s
[INFO] Finished at: 2015-11-10T15:03:43+02:00
[INFO] Final Memory: 17M/168M
[INFO] ------------------------

mvn archetype:create-from-project

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------
[INFO] Building com.skiabox.app10 1.0-SNAPSHOT
[INFO] ------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:create-from-project (default-cli) > generate-sources @ com.skiabox.app10 >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:create-from-project (default-cli) < generate-sources @ com.skiabox.app10 <<<
[INFO]
[INFO] - maven-archetype-plugin:2.4:create-from-project (default-cli) @ com.skiabox.app10 -
[INFO] Setting default groupId: com.skiabox.apps
[INFO] Setting default artifactId: com.skiabox.app10
[INFO] Setting default version: 1.0-SNAPSHOT
[INFO] Setting default package: com.skiabox.apps
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------
[INFO] Building com.skiabox.app10-archetype 1.0-SNAPSHOT
[INFO] ------------------------
[INFO]
[INFO] - maven-resources-plugin:2.7:resources (default-resources) @ com.skiabox.app10-archetype -
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 15 resources
[INFO]
[INFO] - maven-resources-plugin:2.7:testResources (default-testResources) @ com.skiabox.app10-archetype -
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] - maven-archetype-plugin:2.4:jar (default-jar) @ com.skiabox.app10-archetype -
[INFO] Building archetype jar: /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/com.skiabox.app10-archetype-1.0-SNAPSHOT
[INFO] ------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------
[INFO] Total time: 2.103 s
[INFO] Finished at: 2015-11-10T18:06:05+02:00
[INFO] Final Memory: 12M/155M
[INFO] ------------------------
[INFO] Archetype project created in /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype
[INFO] ------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------
[INFO] Total time: 6.371 s
[INFO] Finished at: 2015-11-10T18:06:06+02:00
[INFO] Final Memory: 15M/155M
[INFO] ------------------------

mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------
[INFO] Building com.skiabox.app10-archetype 1.0-SNAPSHOT
[INFO] ------------------------
[INFO]
[INFO] - maven-resources-plugin:2.7:resources (default-resources) @ com.skiabox.app10-archetype -
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 15 resources
[INFO]
[INFO] - maven-resources-plugin:2.7:testResources (default-testResources) @ com.skiabox.app10-archetype -
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] - maven-archetype-plugin:2.4:jar (default-jar) @ com.skiabox.app10-archetype -
[INFO] Building archetype jar: /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/com.skiabox.app10-archetype-1.0-SNAPSHOT
[INFO]
[INFO] - maven-archetype-plugin:2.4:integration-test (default-integration-test) @ com.skiabox.app10-archetype -
[INFO] Processing Archetype IT project: basic
[INFO] --------------------------
[INFO] Using following parameters for creating project from Archetype: com.skiabox.app10-archetype:1.0-SNAPSHOT
[INFO] --------------------------
[INFO] Parameter: groupId, Value: archetype.it
[INFO] Parameter: artifactId, Value: basic
[INFO] Parameter: version, Value: 0.1-SNAPSHOT
[INFO] Parameter: package, Value: it.pkg
[INFO] Parameter: packageInPathFormat, Value: it/pkg
[INFO] Parameter: version, Value: 0.1-SNAPSHOT
[INFO] Parameter: package, Value: it.pkg
[INFO] Parameter: groupId, Value: archetype.it
[INFO] Parameter: artifactId, Value: basic
[WARNING] Don't override file /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic/.idea/libraries/Maven__junit_junit_4_12.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic/.idea/copyright/profiles_settings.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic/.idea/dictionaries/Administrator.xml
[INFO] project created from Archetype in dir: /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic
[INFO]
[INFO] - maven-install-plugin:2.5.2:install (default-install) @ com.skiabox.app10-archetype -
[INFO] Installing /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/target/com.skiabox.app10-archetype-1.0-SNAPSHOT.jar to /Users/Administrator/.m2/repository/com/skiabox/apps/com.skiabox.app10-archetype/1.0-SNAPSHOT/com.skiabox.app10-archetype-1.0-SNAPSHOT.jar
[INFO] Installing /Users/Administrator/IdeaProjects/NextGenerationProject1/target/generated-sources/archetype/pom.xml to /Users/Administrator/.m2/repository/com/skiabox/apps/com.skiabox.app10-archetype/1.0-SNAPSHOT/com.skiabox.app10-archetype-1.0-SNAPSHOT.pom
[INFO]
[INFO] - maven-archetype-plugin:2.4:update-local-catalog (default-update-local-catalog) @ com.skiabox.app10-archetype -
[INFO] ------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------
[INFO] Total time: 2.587 s
[INFO] Finished at: 2015-11-17T01:08:59+02:00
[INFO] Final Memory: 14M/220M
[INFO] ------------------------

mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] - maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom -
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> com.skiabox.apps:com.skiabox.app6-archetype (com.skiabox.app6-archetype)
2: local -> com.skiabox.apps:com.skiabox.app10-archetype (com.skiabox.app10-archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 2
Define value for property 'groupId': : com.skiabox.apps
Define value for property 'artifactId': : com.skiabox.app15
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com.skiabox.apps: :
Confirm properties configuration:
groupId: com.skiabox.apps
artifactId: com.skiabox.app15
version: 1.0-SNAPSHOT
package: com.skiabox.apps
Y: :
[INFO] --------------------------
[INFO] Using following parameters for creating project from Archetype: com.skiabox.app10-archetype:1.0-SNAPSHOT
[INFO] --------------------------
[INFO] Parameter: groupId, Value: com.skiabox.apps
[INFO] Parameter: artifactId, Value: com.skiabox.app15
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.skiabox.apps
[INFO] Parameter: packageInPathFormat, Value: com/skiabox/apps
[INFO] Parameter: package, Value: com.skiabox.apps
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.skiabox.apps
[INFO] Parameter: artifactId, Value: com.skiabox.app15
[WARNING] Don't override file /Users/Administrator/IdeaProjects/TempProject/com.skiabox.app15/.idea/libraries/Maven__junit_junit_4_12.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/TempProject/com.skiabox.app15/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/TempProject/com.skiabox.app15/.idea/copyright/profiles_settings.xml
[WARNING] Don't override file /Users/Administrator/IdeaProjects/TempProject/com.skiabox.app15/.idea/dictionaries/Administrator.xml
[INFO] project created from Archetype in dir: /Users/Administrator/IdeaProjects/TempProject/com.skiabox.app15
[INFO] ------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------
[INFO] Total time: 43.142 s
[INFO] Finished at: 2015-11-17T01:29:53+02:00
[INFO] Final Memory: 15M/220M
[INFO] ------------------------

Administrator@Stavross-MacBook-Pro:~/IdeaProjects/TempProject/com.skiabox.app15$ tree
.
├── NextGenerationProject1.iml
├── pom.xml
└── src
├── main
│ └── java
│ └── com
│ └── skiabox
│ └── apps
│ └── App.java
└── test
└── java
└── com
└── skiabox
└── apps
└── AppTest.java

11 directories, 4 files

Subscribe

Subscribe to our e-mail newsletter to receive updates.


Back to Featured Articles on Logo Paperblog

Magazines