-
Notifications
You must be signed in to change notification settings - Fork 15
Home
The following example details the steps required to conduct a Maven build with Koji. You will need the scm url of the source code you are building along with the release tag of the build. Koji expects release builds so make sure there are no dependencies on SNAPSHOT builds. There are working examples provided for the relevant steps to demonstrate the exact command lines used.
- As the koji user
su - koji
1 . Delete the local maven repo as we want to start with a fresh build.
rm -rf ~/.m2/
2 . Check out the source code
cd workspace git clone https://github.com/<source>.git
example:
git clone https://github.com/sbadakhc/buildmetadata-maven-plugin.git
3 . Make sure you checkout a stable release tag
cd <source> git checkout <release tag>
example:
cd buildmetadata-maven-plugin && git checkout buildmetadata-maven-plugin-1.3.1
If you have a previous build.log you should remove that as well
rm build.log
4 . Run local maven build to generate a build log.
mvn -C -B dependency:resolve-plugins clean install -Dmaven.test.skip=true | tee build.log
5 . Load dependencies into Koji.
/opt/kojak/scripts/build/mead-load-build-dependencies build.log
Once the dependencies have been loaded and all the tasks have completed you can continue.
6 . Tag the package to the appropriate tag.
koji add-pkg --owner=koji <tag> <package>
example:
koji add-pkg rcm-mw-tools-candidate com.redhat.rcm.maven.plugin-buildmetadata-maven-plugin --owner
7 . Run the koji build.
/opt/kojak/scripts/run-maven-build <scm-url>
example:
koji maven-build -Dmaven.test.skip=true rcm-mw-tools-candidate git+https://github.com/sbadakhc/buildmetadata-maven-plugin.git#7130058036a80c727810f0beb55488ee0ff7ba15