Skip to content

Development

Philip Helger edited this page Oct 23, 2023 · 6 revisions

This page encapsulates the most relevant aspects on development with phase4

Submodules

phase4 currently consists of the following submodules:

  • phase4-lib - basic data structures for AS4 handling, sending and receiving
  • phase4-profile-... - AS4 profile for ... as well as the PMode and the respective validation
  • phase4-test - integration test project
  • phase4-server-webapp - Standalone AS4 server for demo purposes
  • phase4-dynamic-discovery - a shared library that contains common stuff for dynamic discovery using SML and SMP
  • phase4-...-client - a specific client to send messages using the ... profile
  • phase4-peppol-servlet - a specific servlet that can be used to receive messages from Peppol
  • phase4-peppol-server-webapp - a simple standalone Peppol AS4 server for demo purposes
  • phase4-spring-boot-demo - an example how to integrate phase4 with Spring Boot

Usage with Maven

If you want to use phase4 with Maven I suggest the following way:

  1. add the BOM into your <dependencyManagement> section and
  2. add the main artefacts without version in the <dependency> block to have a consistent versioning:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
...
  <dependencyManagement>
    <dependencies>
...
      <!-- step 1 -->
      <dependency>
        <groupId>com.helger.phase4</groupId>
        <artifactId>phase4-parent-pom</artifactId>
        <version>x.y.z</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
...
    </dependencies>
  </dependencyManagement>
...
  <dependencies>
...
    <!-- step 2 -->
    <dependency>
      <groupId>com.helger.phase4</groupId>
      <artifactId>phase4-lib</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.phase4</groupId>
      <artifactId>phase4-profile-peppol</artifactId>
    </dependency>
...
  </dependencies>
...
</project>

Building from source

Apache Maven needed v3.6 or later and Java JDK 11 or later is required. The solution is developed with Adoptium formerly known as AdoptOpenJDK.

To build the whole package on the commandline use mvn clean install -U.

If you are importing this into your IDE and you get build errors, it maybe necessary to run mvn process-sources once in the phase4-lib subproject. Afterwards the folder target/generated-sources/xjc must be added to the source build path. When building only on the commandline, this is done automatically.