/barcode4j

This barcode4j fork was migrated from Sourceforge svn with full commit history

Primary LanguageJavaApache License 2.0Apache-2.0

Barcode4j

Maven Ant Maven Central Javadocs

Barcode4J is a flexible generator for barcodes written in Java and available under the Apache License v2.0. Features

Forked from Sourceforge barcode4j:

Barcode4j was originally developed by Jeremias Märki and Marc Guillemot with code available on Sourceforge under Apache License v2.0.

It's not been updated in some time so this fork was made with the intention of merging in the various changes that people have tried to add over the years.

There is another barcode4j on github but it's not being maintained and the svn history was not maintained.

This fork has the following goals:

  • Keeping the svn history
  • Enabling continuous integration for multiple Java versions
  • Dropping support for Java < 8 (supporting newer LTS releases such as 11 and 17 is priority)
  • Move to standard maven project structure
  • Pulling in various svn patches and git merge requests
  • Adding Test Coverage
  • Publish build artifacts to maven central
  • Support the latest Saxon version**
  • Add JPMS support (in version 3 and above, 2.* releases will continue to support JDK 8)

** I hope to add support for recent versions of Saxon (10 & 11) but now Saxonica ships 3 builds: Saxon-HE, Saxon-PE, and Saxon-EE. The first of which (Home Edition) is available via maven. I did the initial work to update but it turns out element extensibility is not available in Saxon Home Edition (the net.sf.saxon.style.ExtensionElementFactory that is required is not available).

Compatibility with the original barcode4j

V2 (drop in replacement):

Initially the project will continue to be a compatible drop-in replacement for existing use of net.sf.barcode4j:barcode4j:2.1:

  • The v2.* releases will continue to have the existing org.krysalis.barcode4j package names.
  • Both the barcode4j, barcode4j-xgc and barcode4j-fop-ext artifacts will be published.
  • Releases will support JDK 1.7 and above.
    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>barcode4j</artifactId>
        <version>2.2.1</version>
    </dependency>

V3 (minor changes):

In version 3 the project will continue to be compatible for the most part. Older JDK's won't be supported but most users will not be affected.

The only changes required by users will be to change import paths to the newer package name:

  • Package names will be updated to com.singingbush.barcode4j equivalent
  • Drop support for JDK 7 (potentially only support JDK 11 and above)
  • Drop all uses of the now defunct Avalon Framework. See issue #15
  • Remove Saxon support (as Saxonica don't include the required interface in Saxon HE, and it seems the saxon extension was never published)
  • Remove the Ant build
  • Support Java modules (JPMS) via proper use of module-info.java files in the source. (If JDK 8 is supported this will be via multi-release jar)

Build

Maven (in future the project will only support maven)

mvn package

Ant

Make sure to have both ant and ant-junit5 installed. On Fedora this can be done with sudo dnf install ant ant-junit5, on Ubuntu using sudo apt install ant ant-optional junit5 should be enough but Ubuntu doesn't ship ant-junitlauncher yet, see launchpad bug.

Builds can be performed using:

ant -buildfile barcode4j/build.xml

or

ant -buildfile barcode4j/build-dist.xml