Skip to content

SingingBush/barcode4j

Repository files navigation

Barcode4j

Maven Ant Maven Central Javadocs CodeQL SonarCloud

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

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
  • Support latest JDK versions (for now Java 1.7 and above are supported but future releases will require JDK 11 or above)
  • Support GraalVM Native Image (changes were needed to allow barcode4j to be AOT compiled for use with GraalVM and/or Quarkus)
  • Move to standard maven project structure (Ant build will be removed later)
  • Publish build artifacts to maven central singingbush group on maven.org
  • Improve Test Coverage (this is ongoing but better than it was)
  • Publish JaCoCo report results
  • Add static analysis (SonarCloud, CodeQL, and Qodana)
  • Add JPMS support (in version 3 and above, 2.* releases will continue to support JDK 7 for now)
  • Pulling in various svn patches and git merge requests
  • Either remove or update the Saxon code to support the latest Saxon EE version**
  • Remove dependency on Avalon-Framework (in version 3 and above, Avalon was retired years ago. See: #15)

** Support for Saxon was never published to Maven central before and these days Saxonica ship 3 versions (Saxon-HE, Saxon-PE, and Saxon-EE). The first of which (Home Edition) is available via maven central but the net.sf.saxon.style.ExtensionElementFactory class that is required is not available. Saxon EE is now available via Saxonica's maven repository so it may be able to revive the code to use Saxon 11 or 12. If this proves to be a pain then the related code will be removed.

Compatibility with the original barcode4j

V2 (drop in replacement):

This fork should work as a drop in replacement of net.sf.barcode4j:barcode4j:2.1 for most users. Please note however that the original was a fat-jar that included classes that are now in the barcode4j-ant, barcode4j-cli, barcode4j-servlet, and barcode4j-xalan sub-modules. The singingbush barcode4j is more aligned to the barcode4j-light package that was last released in 2008.

That said, if you've been using net.sf.barcode4j:barcode4j:2.1 then switching to the latest com.singingbush:barcode4j:2.+ should simply be a case of choosing the dependencies you require. In most cases this is likely to be a combination of com.singingbush:barcode4j:2.+ and com.singingbush:barcode4j-fop-ext:2.+.

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.
  • The barcode4j, barcode4j-fop-ext, barcode4j-xgc and barcode4j-xalan artifacts are published to maven central.
  • Releases will support JDK 1.7 and above.
    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>barcode4j</artifactId>
        <version>2.2.3</version>
    </dependency>
    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>barcode4j-xalan</artifactId>
        <version>2.2.3</version>
    </dependency>
    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>barcode4j-xgc</artifactId>
        <version>2.2.3</version>
    </dependency>
    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>barcode4j-fop-ext</artifactId>
        <version>2.2.3</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
  • Saxon support will be updated to work with the latest Saxon EE (Saxonica now have a Maven repository for Saxon EE)
  • 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

About

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

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages