Build from source

Apache SIS is built by Maven. For installing the JAR files in the local Maven repository, execute the following command from the SIS project root:

mvn install

The remaining of this page provides more advanced tips for SIS developers.

Distribution file and Pack200 bundle

The Pack200 bundle is a file with the .pack.gz extension containing all SIS modules except sis-webapp (because Web applications use an other packaging) together with their dependencies. Pack200 files are uncompressed by the unpack200 command provided in JDK/JRE installation. However for users convenience, we provide a shell script for uncompressing and launching the SIS command line tool in a single step. That shell script, together with the Pack200 file and other files (README, LICENSE, etc.) are bundled in a ZIP file created as below:

mvn org.apache.sis.core:sis-build-helper:dist --non-recursive

Do not forget the --non-recursive option, otherwise the Mojo will waste CPU by executing itself many time. Optionally, the Apache SIS version can be inserted as a 4th element between sis-build-helper: and :dist if there is many versions of the plugin in the local repository.

The result will be created in the target/distribution/apache-sis-<version>.zip file. To test, uncompress in any directory and execute apache-sis-<version>/bin/sis. The Pack200 file will be automatically uncompressed when first needed.

Generating the Pack200 file alone

If only the Pack200 file is desired, without the distribution ZIP file, one can use the following command:

mvn org.apache.sis.core:sis-build-helper:pack --non-recursive

The above command should create a target/distribution/apache-sis-<version>.pack.gz file. To uncompress that file, use the following command:

unpack200 --remove-pack-file apache-sis-<version>.pack.gz sis.jar

The Pack200 bundle does not include the sis-webapp module because the later can be downloaded as a WAR file from the Maven repository.

Known limitations

The current plugin implementation has some hard-coded values, especially:

  • The ZIP file content is copied from the application/sis-console/src/main/artifact directory.
  • The Pack200 file path inside the ZIP file is hard-coded to lib/sis.pack.gz.
  • The final filename is hard-coded to apache-sis-<version>.zip.

SIS-specific Maven plugin

Apache SIS uses a sis-build-helper plugin for SIS-specific tasks and Javadoc customization. This plugin is used automatically by mvn install. Consequently the remaining of this page can be safely ignored. This page is provided only as a reference for developers wanting to take a closer look to SIS pom.xml file.

Localized resources compiler

Localized resources are provided in *.properties files as specified by the java.util.PropertyResourceBundle standard class. However SIS does not use those resources files directly. Instead *.properties files are transformed into binary files having the same filename but the .utf extension. This conversion is done for efficiency, for convenience (the compiler applies the java.text.MessageFormat doubled single quotes rule itself), and for compile-time safety.

In addition to generating the *.utf files, the resource compiler may modify the *.java files having the same name than the resource files. For example given a set of Vocabulary*.properties files (one for each supported language), the compiler will generate the corresponding Vocabulary*.utf files, then look for a Vocabulary.java source file. If such source file is found and contains a public static inner class named Keys, then the compiler will rewrite the constants declared in that inner class with the list of keys found in the Vocabulary*.properties files.

The resource compiler is executed at Maven build time if the pom.xml file contains the following declaration. Note that current implementation looks only for resources in any package ending with the resources name; all other packages are ignored.

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.sis.core</groupId>
      <artifactId>sis-build-helper</artifactId>
      <version>${sis.plugin.version}</version>
      <executions>
        <execution>
          <goals>
            <goal>compile-resources</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

The resources compilation is part of the build process and does not need to be run explicitly. However, if necessary the resources compiler can be invoked alone by the following command line in the module containing the resources to recompile. This is sometime useful for regenerating the constants in the Keys inner class in a feaster way than building the project.

mvn org.apache.sis.core:sis-build-helper:compile-resources

JAR files collector

Links or lists all JAR files (including dependencies) in the target/binaries directory of the parent project. This plugin performs a work similar to the standard Maven assembly plugin work, with the following differences:

  • In multi-modules projects, this plugin does not create anything in the target directory of sub-modules. Instead, this plugin groups everything in the target/binaries directory of the parent module.
  • This plugin does not create any ZIP file. It only links or lists JAR files. The JDK7 and above versions of this plugin use hard links on platforms that support them, so execution of this plugin should be very cheap and consume few disk space.
  • Dependencies already present in the target/binaries directory are presumed stables and are not overwritten. Only artifacts produced by the Maven build are unconditionally overwritten.

This plugin can be activated by the following fragment in the parent pom.xml file:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.sis.core</groupId>
      <artifactId>sis-build-helper</artifactId>
      <version>${sis.plugin.version}</version>
      <executions>
        <execution>
          <goals>
            <goal>collect-jars</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>