Please note that Sincerity is still under development and that this documentation is incomplete.
- You've created a useful skeleton, skeleton add-on or plugin, which you would like to share with others for use in their Sincerity containers. A package, of course, is the most natural way to do so. You could then host your package on your own repository, or submit it for inclusion in other public repositories.
- Packages are very useful for deploying your application internally, especially in ephemeral "cloud" environments. Programmers working on different modules could package their results, using a clear versioning system. You would then host the packages in your own private repository, using Nexus or even a plain directory. Deployment, including upgrades, would thus involve nothing more than running "sincerity install" on the relevant containers. It also allows easy downgrading of applications, or setting modules to specific versions for testing and debugging.
Note that "packaging" here refers specifically to creating Sincerity packages, which you can then install into Sincerity containers as dependencies. If what you want is to distribute the entire container, then see the Distribution Plugin, and also the Sincerity Runtime Plugin.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.myorg.myapp</groupId> <artifactId>myapp</artifactId> <version>1.0.0</version> <packaging>pom</packaging> <name>My Cool Application</name> <description>This is an application packaged for use with Sincerity.</description> <dependencies> <dependency> <groupId>com.threecrickets.savory</groupId> <artifactId>savory-framework</artifactId> <version>1.0-beta1</version> </dependency> </dependencies> <build> <directory>cache</directory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>jar</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <appendAssemblyId>false</appendAssemblyId> <archive> <manifestEntries> <Package-Folders>package</Package-Folders> </manifestEntries> </archive> <descriptors> <descriptor>package.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
- You can add as many dependencies as you like. Note that they can plain JVM jars, Sincerity packages, Python packages, Ruby gems, etc.: anything supported by Sincerity. In this case, we are including the Savory Framework, which is a Sincerity package (which in turn has dependencies). You can also have no dependencies at all.
Under <manifestEntries> you can add anything that adheres to the packaging specification. For example, you may want to call a package installation script, like so:
<Package-Installer>com.threecrickets.sincerity.Sincerity delegate:start /libraries/scripturian/installers/myapp/</Package-Installer>
- The <directory> is a work directory used by Maven for creating your final package. You may want to specify it as "/tmp". It is relative to the location of the "pom.xml" file.
- If you want to share your package in a public repository, you'd likely want to add additional information about your package. Consult the Maven pom.xml guide for more options.
<?xml version="1.0" encoding="UTF-8"?> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>jar</id> <formats> <format>jar</format> </formats> <baseDirectory>package</baseDirectory> <fileSets> <fileSet> <directory>path-to-package</directory> <outputDirectory>.</outputDirectory> <includes> <include></include> </includes> </fileSet> </fileSets> </assembly>
mvn deploy -DaltDeploymentRepository=myrepo::default::file:/path-to-local-repository/
The Sincerity Manual is provided for you under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The complete manual is available for download as a PDF.