Developing OpenCms with Maven (inkl. Eclipse)

From OpenCms Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: == Developing OpenCms with Maven == Creating the template of the Opencms-Module is as easy as executing: <source lang="dos"> mvn archetype:generate -DarchetypeCatalog=http://bp-cms-commo...)
 
(Developing OpenCms with Maven)
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
<source lang="dos">
 
<source lang="dos">
mvn archetype:generate -DarchetypeCatalog=http://bp-cms-commons.sourceforge.net/m2repo
+
mvn archetype:generate -DarchetypeCatalog=http://bp-cms-commons.sourceforge.net
 
</source>
 
</source>
 
Select option 1, set properties and that's all!
 
Select option 1, set properties and that's all!
  
See http://bp-cms-commons.sourceforge.net/m2site/infonova/archetypes/opencms-module-archetype/1.0/
+
See http://bp-cms-commons.sourceforge.net/m2site/infonova/archetypes/opencms-module-archetype/1.0.1/
  
 
=== Pros ===
 
=== Pros ===
Line 16: Line 16:
 
* Eclipse: create your Eclipse-config with "mvn eclipse:eclipse"
 
* Eclipse: create your Eclipse-config with "mvn eclipse:eclipse"
 
* UnitTests: Real OpenCms Unittest which starts an Opencms instance and reas OpenCms configurations already works.
 
* UnitTests: Real OpenCms Unittest which starts an Opencms instance and reas OpenCms configurations already works.
 +
 +
=== Limitation ===
 +
 +
* ArtifactId must be the OpenCms Module Name (This simplify the build-Process). The OpenCms Modulename must be a valid classpath (This is the package where OpenCms search a message.properties at Startup).
  
 
=== Recommendations ===
 
=== Recommendations ===
Line 21: Line 25:
 
For your own Project you should copy the parent pom.xml and modify it (at least SCM and distributionManagement section):
 
For your own Project you should copy the parent pom.xml and modify it (at least SCM and distributionManagement section):
  
http://bp-cms-commons.sourceforge.net/m2repo/at/infonova/opencms/modules/modules-parent/1.1/modules-parent-1.1.pom
+
http://bp-cms-commons.sourceforge.net/m2repo/at/infonova/opencms/modules/modules-parent/1.2/modules-parent-1.2.pom
 +
 
 +
 
 +
[[Category:Developing in OpenCms ]]

Latest revision as of 19:50, 29 May 2012

Contents

Developing OpenCms with Maven

Creating the template of the Opencms-Module is as easy as executing:

mvn archetype:generate -DarchetypeCatalog=http://bp-cms-commons.sourceforge.net

Select option 1, set properties and that's all!

See http://bp-cms-commons.sourceforge.net/m2site/infonova/archetypes/opencms-module-archetype/1.0.1/

Pros

  • Build with Maven: you can use all Maven Plugins to analyze your code.
  • The maven release plugin works also fine.
  • Eclipse: create your Eclipse-config with "mvn eclipse:eclipse"
  • UnitTests: Real OpenCms Unittest which starts an Opencms instance and reas OpenCms configurations already works.

Limitation

  • ArtifactId must be the OpenCms Module Name (This simplify the build-Process). The OpenCms Modulename must be a valid classpath (This is the package where OpenCms search a message.properties at Startup).

Recommendations

For your own Project you should copy the parent pom.xml and modify it (at least SCM and distributionManagement section):

http://bp-cms-commons.sourceforge.net/m2repo/at/infonova/opencms/modules/modules-parent/1.2/modules-parent-1.2.pom

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox