How to Integrate InstallBuilder with Apache Ant and Apache Maven

asked 14 Sep '11, 09:36

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


Apache Ant and Apache Maven are two of the most popular tools for building projects. This article explains how to integrate InstallBuilder with these two tools.

If you use Apache Ant for building your projects, you can include the following section for building your binary installer.

build.xml

<project name="MyProject">
    <exec executable="/home/bitrock/installbuilder-6.2.4/bin/builder">
        <arg line="build /home/bitrock/installbuilder-6.2.4/projects/demo.xml linux"></arg>
    </exec>
</project>

Where the executable tag sets the path of the builder program and the arg tag defines the build process, the location of your InstallBuilder project file and the target platform.

During the build process, you will see something similar to:

Buildfile: build.xml
     [exec]  Building Demo Project linux
     [exec]  0% ______________ 50% ______________ 100%
     [exec]  #########################################
     [exec]

BUILD SUCCESSFULTotal time: 1 second

If you use Apache Maven for building your projects, you can find below an example of a pom.xml file to build a demo project.

pom.xml

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1</version>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>/home/bitrock/installbuilder-6.2.4/bin/builder</executable>
          <arguments>
            <argument>build</argument>
            <argument>/home/bitrock/installbuilder-6.2.4/projects/demo.xml</argument>
            <argument>linux</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

The executable tag contains the path to the builder program and the argument tags describe the build process, the location of your InstallBuilder project file and the platform target.

You can launch the build using the following command:

$ mvn exec:exec

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.mycompany.app:my-app:jar:1
[INFO]    task-segment: [exec:exec]
[INFO] ------------------------------------------------------------------------
[INFO] [exec:exec {execution: default-cli}]
[INFO]  Building Demo Project linux
[INFO]  0% ______________ 50% ______________ 100%
[INFO]  #########################################
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Nov 05 11:47:09 CET 2009
[INFO] Final Memory: 3M/64M
[INFO] ------------------------------------------------------------------------
link

answered 14 Sep '11, 09:41

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×2
×1
×1

Asked: 14 Sep '11, 09:36

Seen: 765 times

Last updated: 14 Sep '11, 09:41