Home

Awesome

ph-ubl

Maven Central javadoc CodeCov

This is the readme file for version 5.x or later.

Set of Java libraries for reading and writing OASIS UBL 2.0, 2.1, 2.2, 2.3 and 2.4 documents. The following projects are contained:

Building

This project requires Java 1.8 or higher to be build and used.

The JAXB generated sources are created dynamically via mvn process-sources and are not part of the committed source files. This is also automatically called when you call mvn clean install. The folders with the generated sources differ from subproject to subproject:

Examples

An example for reading and writing UBL 2.0 files can be found in the test file UBL20FuncTest.java. An example to create an invoice from scratch can be found in the test code CreateInvoiceFromScratchFuncTest.java.

An example for reading and writing UBL 2.1 files can be found in the test file UBL21FuncTest.java. An example to create an invoice from scratch can be found in the test code CreateInvoiceFromScratchFuncTest.java.

Maven usage generic

You can use ph-ubl as a BOM (bill of material) when you include the following in the dependencyManagement section of your POM, replacing x.y.z with the effective version number:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl-parent-pom</artifactId>
  <version>x.y.z</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL 2.0

To read and write UBL 2.0 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl20</artifactId>
  <version>x.y.z</version>
</dependency>

To also use the generated enums for the UBL 2.0 codelists add the following artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl20-codelists</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL 2.1

To read and write UBL 2.1 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl21</artifactId>
  <version>x.y.z</version>
</dependency>

To also use the generated enums for the UBL 2.1 codelists add the following artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl21-codelists</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL 2.2

To read and write UBL 2.2 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl22</artifactId>
  <version>x.y.z</version>
</dependency>

To also use the generated enums for the UBL 2.2 codelists add the following artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl22-codelists</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL 2.3

To read and write UBL 2.3 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl23</artifactId>
  <version>x.y.z</version>
</dependency>

To also use the generated enums for the UBL 2.3 codelists add the following artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl23-codelists</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL 2.4

To read and write UBL 2.4 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl24</artifactId>
  <version>x.y.z</version>
</dependency>

To also use the generated enums for the UBL 2.4 codelists add the following artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl24-codelists</artifactId>
  <version>x.y.z</version>
</dependency>

Supported since v8.0.0

Maven usage UBL-tr

To read and write UBL-tr (http://www.ubltr.com/) documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubltr</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage UBL-PE

To read and write UBL-PE 2.0 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ublpe</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage Dian UBL

To read and write Dian UBL 2.1 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl-dian</artifactId>
  <version>x.y.z</version>
</dependency>

Note: prior to v6.3.0 the Maven groupId was com.helger.

Maven usage eForms UBL

To read and write eForms UBL 2.3 documents add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.ubl</groupId>
  <artifactId>ph-ubl-eforms</artifactId>
  <version>x.y.z</version>
</dependency>

Supported since v6.7.0

Gradle considerations

Old versions of this project rely on JDK version based Maven profile activation. See https://github.com/phax/ph-jaxb-pom#gradle-usage for help on this specific issue.

Download

Binary versions of the artefacts can be downloaded from Maven Central:

Other UBL sites

For further information on the Universal Business Language can be found on the following pages:

News and noteworthy


My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.