4.3. Java Applications

Use this section if the software you're packaging is compiled Java code that is ready to launch in any Java Runtime Environment (JRE).

Packaging from JAR Files

Future editions of this documentation will include information on packaging your Java application from its original source, provided in Java Archive (JAR) files.

Use the following as a template for starting your recipe to package your pre-compiled Java application:

# RECIPE TEMPLATE
# Package pre-compiled Java software
loadSuperClass('javapackage=conary.rpath.com@rpl:1')
class ExampleApp(JavaPackageRecipe):
    name = 'example'
    version = '1.0'
    buildRequires = []
    
    def upstreamUnpack(r):
        r.addArchive('http://www.example.com/%(example)s/%(example)s-%(version)s.tgz')
    

Replace the class name, package name, version, and archive location as appropriate for packaging the files for your Java application. Each source or archive you add can be just a file name (if you're checking in those files with the recipe), a network-accessible location as shown in the template example, or a version control checkout action from among Conary's source actions.

Reference all the other actions you can add to your recipe in Conary Recipe Actions, Macros, and Variables at docs.rpath.com/conary.