This is the simplest packaging mode available. It will package the application in a single jar file, by unpacking all dependencies and packing them once more in a sole file, so place close attention to potential duplicate entries, especially those found inside META-INF.

griffon package jar

Arguments:

Configuration Options:

There's a high chance of some files to have duplicates, e.g. griffon-artifacts.properties if you have installed a plugin that provides MVC groups. It's possible to instruct the build to merge duplicate files by specifying a regular expression and a merging strategy. The following table explains the different merging strategies available

StrategyDescription
SkipDo not perform any merge. Duplicate is discarded.
ReplaceDuplicate is preferred and overwrites previous.
AppendDuplicate is appended at the end of previous.
MergeCommon lines found in duplicate are discarded. New lines found in duplicate are appended at the end.
MergeManifestDuplicate keys override the previous ones. New keys are added to the merged result.
MergePropertiesDuplicate keys override the previous ones. New keys are added to the merged result.
MergeGriffonArtifactsMerges artifact definitions per type.

You can specify merging preferences in BuildConfig.groovy like this

griffon {
    jars {
        merge = [
            '.*.xml': org.codehaus.griffon.ant.taskdefs.FileMergeTask.Replace
        ]
    }
}

This setting will overwrite any XML file found in the path with the last version encountered as jars are processed. The griffon build defines a set of default mappings, which are the ones found in the next table

RegexpMergeStrategy
META-INF/griffon-artifacts.propertiesMergeGriffonArtifacts
META-INF/MANIFEST.MFMergeManifest
META-INF/services/.*Merge
.*.propertiesMergeProperties

Merging preferences must be defined from the most specific to the least. Your preferences will override any default settings.