/
1. Create your project from the archetype
1. Create your project from the archetype
This project is based on maven archetype technology that has been included in the product since Abiquo-4.0.4, so you must use the latest version for the Abiquo installation.
To create your own backup plugin project using archetype, just run:
mvn archetype:generate -DarchetypeGroupId=com.abiquo -DarchetypeArtifactId=backup-plugin-archetype \
-DarchetypeVersion=<abiquo-version> \
-DgroupId=<your-group-id> \
-DartifactId=<your-artifact-id> \
-DinteractiveMode=true -Dgoals=compile
Replacing:
abiquo-version : The version of the maven archetype, which is the same as that of the Abiquo installation. For example: 4.0.4
your-group-id : The group id of the maven project. Usually this is the enterprise that owns the project, for example we use com.abiquo.
your-artifact-id: The name of the project. For example myownplugin.
Example:
Example of command run and output
>> mvn archetype:generate -DarchetypeGroupId=com.abiquo -DarchetypeArtifactId=backup-plugin-archetype \
-DarchetypeVersion=4.0.4 \
-DgroupId=org.example \
-DartifactId=myownplugin \
-DinteractiveMode=true -Dgoals=compile
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [com.abiquo:backup-plugin-archetype:4.0.4] found in catalog local
[INFO] Using property: groupId = org.example
[INFO] Using property: artifactId = myownplugin
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' org.example.myownplugin: :
Confirm properties configuration:
groupId: org.example
artifactId: myownplugin
version: 1.0-SNAPSHOT
package: org.example.myownplugin
Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: backup-plugin-archetype:4.0.4
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.example
[INFO] Parameter: artifactId, Value: myownplugin
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.example.myownplugin
[INFO] Parameter: packageInPathFormat, Value: org/example/myownplugin
[INFO] Parameter: package, Value: org.example.myownplugin
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: org.example
[INFO] Parameter: artifactId, Value: myownplugin
[INFO] Project created from Archetype in dir: /tmp/mvn/myownplugin
[INFO] Invoking post-archetype-generation goals: compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:myownplugin:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.abiquo:platform:4.0.4, /home/sergi/.m2/repository/com/abiquo/platform/4.0.4/platform-4.0.4.pom, line 2223, column 29
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Custom Abiquo Backup Plugin 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ myownplugin ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myownplugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myownplugin ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /tmp/mvn/myownplugin/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.181 s
[INFO] Finished at: 2017-11-22T17:52:15+01:00
[INFO] Final Memory: 23M/619M
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.249 s
[INFO] Finished at: 2017-11-22T17:52:16+01:00
[INFO] Final Memory: 20M/619M
[INFO] ------------------------------------------------------------------------
This will create a directory tree like:
myownplugin
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── org
│ │ └── example
│ │ └── myownplugin
│ │ ├── CustomBackupConnection.java
│ │ └── CustomBackupPlugin.java
│ └── resources
│ └── META-INF
│ └── services
│ └── com.abiquo.backup.plugin.BackupScheduling
└── test
└── resources
├── logback-test.xml
└── testng
├── it-all.xml
├── it-basic.xml
├── it-none.xml
├── it-single.xml
├── test-all.xml
├── test-basic.xml
├── test-none.xml
└── test-single.xml
12 directories, 13 files
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved