You can use the Maven Pre-Prepare plug-in to pre-prepare a C-App pom.xml
file for mvn package goal by enabling the system scope and system path. Given that mvn install goal is widely used compared to mvn package goal, this plug-in is an optional feature for a developer. This plug-in needs to be executed only after finalizing any artifact changes done in Developer Studio.
Table of Contents |
---|
Creating WSO2 artifacts
Create your favorite artifact projects (ESB Config, Registry, Axis2 etc.) inside a Maven Multi Module project in Developer Studio.
Under the same Multi Module project, create a Composite Application project in which you will define which artifacts are to be packed.
- Finalize any changes in the developed artifacts and select them in the C-App POM editor view.
Prepare artifacts for Maven package goal (using system-scope goal)
You can execute the plug-in from inside Eclipse or using the console.
It is always necessary to execute this plugin on the root of a Maven Multi Module project.
Multiple levels of Maven Multi Module projects are supported.
This plug-in traverses through all the sub modules of a project and maps system paths of artifacts to dependencies in the C-App
pom
file.During the build process, you need to provide consent (Y/n) to proceed with changing of the C-App
pom
file with system scope and system path. Default input is Y.If you need to update only selected C-App projects where multiple C-App projects are present, this consent can be provided differently.
- If the build needs to be automated, this consent can be provided as an optional parameter in the mvn string:
mvn org.wso2.maven:wso2-maven-package-prepare-plugin:system-scope -DupdateDependencies=true
Execute Maven plug-in from inside Eclipse
- Right-click the Maven Multi Module project and click Run as > Run Configurations.
- In the dialog box that appears, double click Maven Build in the tree view. To select a base directory, click Browse Workspace and browse to the previously created Maven Multi Module project.
- In the Goals field, enter
org.wso2.
maven:wso2-maven-package-prepare-plugin:system-scope
and click Run.
Execute Maven plug-in from a console
Navigate to the previously created Maven Multi Module project location and enter mvn org.wso2.maven:wso2-maven-package-prepare-plugin:system-scope
.
Code Block |
---|
[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] ESB_config_sample [INFO] Registry_sample [INFO] CAPP_sample [INFO] MavenParentProject_sample [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building MavenParentProject_sample 1.0.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wso2-maven-package-prepare-plugin:1.0.0-SNAPSHOT:system-scope (default-cli) @ MavenParentProject_sample --- [info] MavenPackagePrepare plugin execution started [info] About to update: /home/gayan/Documents/Test/3.8.0Alpha/workspace/MavenParentProject_sample/CAPP_sample/pom.xml [warn] All dependencies will be converted to system scope Continue? (Y/n): y [info] All dependencies were converted to system scope [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] ESB_config_sample ................................. SKIPPED [INFO] Registry_sample ................................... SKIPPED [INFO] CAPP_sample ....................................... SKIPPED [INFO] MavenParentProject_sample ......................... SUCCESS [ 18.765 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23.000 s [INFO] Finished at: 2015-06-29T14:03:40+05:30 [INFO] Final Memory: 12M/181M [INFO] ------------------------------------------------------------------------ |
The pom
file will now look like the following:
Now, you can proceed with mvm package goal.
Revert to default scope (using default-scope goal)
By replacing the previously used plug-in execution string with default-scope (as shown below), the C-App pom
file can be reverted to its original state.
mvn org.wso2.maven:wso2-maven-package-prepare-plugin:default-scope