thangalin Posted May 5, 2016 Share Posted May 5, 2016 What are the steps to create a distribution library that contains all the:Report imagesInternationalized resource bundlesClass files (for custom functionality)Report templates Link to comment Share on other sites More sharing options...
Solution thangalin Posted May 5, 2016 Author Solution Share Posted May 5, 2016 This answer makes the following assumptions:The class files and resource bundles are located in the "build" directory (should created by default when writing custom Java classes).The distribution directory for the Java archive will be named "dist".The images used by the reports are in an "images" directory and in SVG format.The report templates have been compiled and are in the main project folder.Now:In the project folder create a file named "build_dist.xml"Copy the following content into build_dist.xml:<?xml version="1.0"?><project name="DistributionLibrary" default="dist" basedir="."> <description>Archives templates, bundles, class files.</description> <property name="build" location="build" /> <property name="dist" location="dist" /> <target name="dist" description="Build distribution archive."> <mkdir dir="${dist}" /> <jar destfile="${dist}/templates.jar"> <fileset dir="${build}" includes="**/*" /> <fileset dir="." includes="images/*.svg" /> <fileset dir="." includes="**/*.jasper"/> </jar> </target></project> Right-click on the project name.Select Properties.Select Builders.Click New.Select Ant Builder.Click OK to display the Edit Configuration dialog.Set Buildfile to: ${project_loc}/build_dist.xmlSet Base Directory to: ${project_loc}Click the Targets tab.Click Set Targets beside "After a 'Clean'".Uncheck dist, if it is checked.Click OK.Click Set Targets beside "Manual Build".Check dist, if it is unchecked.Click OK.Click OK to close the Edit Configuration dialog.Click OK to close the Project properties dialog.The archive is now bulit automatically after each successful project build. Try it as follows:Select Project >> Clean.Click OK.In the Console panel you should see BUILD SUCCESSFUL.Once the build is successful, the dist directory will contain a file called templates.jar that contains an archive that can be used as a resource for reports (in a Java application). Link to comment Share on other sites More sharing options...
hozawa Posted May 7, 2016 Share Posted May 7, 2016 From "Project Explorer", just right click on the project (usually the top element in the tree" and select "export" - "General" - "Archive File". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now