Snapcraft + Gradle and Maven
Matthew Aguirre
matt.aguirre at gmail.com
Fri Jul 22 20:04:29 UTC 2016
I have added a new plugin to snapcraft for any that are interested.
It's the ability to build a Java project that uses gradle (more
exactly, one that uses the gradlew wrapper).
I have a quick write up of it here:
http://tros.org/dev/2016/07/13/gradle-in-snapcraft.html
with a demo example in my snapcraft fork:
https://github.com/ZenHarbinger/snapcraft/tree/demo/gradle/demos/gradle
Essentially, the plugin acts similarly to the maven plugin.
- It builds the Java jar/war artifact
- Searches for jar/war files in the 'build/libs' output directory that
is generated during the 'jar' gradle task.
- The output is put in the snap's 'jar' or 'war' directory depending on
the type of the output.
Maven:
Also, I have added the ability to specify maven-targets in the maven
plugin.
This allows a developer to have a composite project file that
references child pom.xml files. Specifying the maven-targets will copy
the jar/war files from the target directories of the child projects
into the snap.
Example:
parts:
algolink-mvn:
plugin: maven
source: .
maven-targets:
- algolink-gui
- algolink-cli
Which allows a user to package the targets of algolink-gui and
algolink-cli into the snap into directories of the target name.
Thanks!
--
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160722/15dbebd3/attachment.html>
More information about the Snapcraft
mailing list