A sample Broadleaf module that has default placeholders for most of the relevant files a module might need.
-
Make a copy of this project.
-
Remove the
.git
folder from the copy -
Before importing into your IDE, edit pom.xml in a text editor and replace MYMODULE with the appropriate module name
-
Import into your IDE
-
Find and replace all instances of MYMODULE (file names, directory names, and contents of files) with the appropriate module name. Below is a helpful unix command for renaming the files ... change "new-module-name" to your module name.
for i in `find . | grep MYMODULE`; do mv $i `echo $i | sed "s/MYMODULE/new-module-name/g"`;done
-
Reserve Module ID range (all SQL that originates from this module should use IDs in this range.) Update the following file ... https://github.com/BroadleafCommerce/docs-internal/blob/master/Module%20IDs.md
-
Delete all placeholder.git files
-
Create a new GitHub project for your module
-
Ensure that you are on a
develop-1.0.x
branch (it must be in the formatdevelop-a.b.x
wherea
andb
are numbers) -
Add the
origin
remote to your new Github project:git remote add origin git@github.com:BroadleafCommerce/MYMODULE.git
-
Push up your project with a
-u
to automatically track your branch:git push -u
This skeleton template has a lot of files. You might not be using all of them. For example, if the module doesn't do any weaving into core Broadleaf entities, you are able to combine bl-MYMODULE-applicationContext.xml
and bl-MYMODULE-base-applicationContext.xml
. If you don't have any special caching configuration, you can remove the ehcache file as well as the reference to it in the XML files.
Basically, don't check in unneeded things. Be dilligent about your work and clean up things that don't belong.
This requires an administrator account within Nexus.
- Go to the Broadleaf Nexus and log in
- Click on 'Repositories' to the left
- Create a Releases repository
- Hit 'Add -> Hosted Repository' at the top and then in the form that appears at the bottom fill out the following
- Repository ID - usually
MYMODULE-releases
all lowercase - Repository Name - Usually
MYMODULE Releases
in correctly-spaced capitalization - Leave all other defaults
- Hit 'Save'
- Now create a Snapshots repository
- Hit 'Add -> Hosted Repository' to add another repo
- Repository ID - usually
MYMODULE-snapshots
all lowercase - Repository Name - usually
MYMODULE Snapshots
in correctly-spaced capitalization - Repository Policy - Snapshot (this changes the Deployment Policy to 'Allow Redeploy')
- leave everything else
- Hit 'Save'
All of this information should point to real things or the next step will fail
The most up-to-date information on what the contents of your Jenkinsfile
should be is in the Jenkins Pipeline library project. Once you push up this change, Jenkins will automatically build and deploy it onto the nexus