Skip to content

Commit

Permalink
#10 Dependency update / sync with IPF
Browse files Browse the repository at this point in the history
* update plugins
* update dependencies
* remove beanutils dependency
* update github actions
  • Loading branch information
Thopap committed Dec 27, 2023
1 parent 6adbdfd commit 71bc5c5
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 89 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 13 ]
java: [ 11, 17 ]
name: Java ${{ matrix.java }} build
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
cache: 'maven'
- name: Build with Maven
run: mvn -B clean package --file pom.xml

Expand Down
4 changes: 0 additions & 4 deletions commons/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,57 @@
package org.openehealth.ipf.gazelle.validation.core;


import static org.openehealth.ipf.gazelle.validation.core.util.MessageUtils.checkMSHEventField;
import static org.openehealth.ipf.gazelle.validation.core.util.MessageUtils.checkMSHTypeField;
import static org.openehealth.ipf.gazelle.validation.core.util.MessageUtils.checkMSHVersionField;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileAssertions.profileNotHL7Compliant;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileAssertions.profileViolatedWhen;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.COMPONENT_NOT_DEFINED_IN_PROFILE;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.COMPONENT_TYPE_MISMATCH;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.FIELD_NOT_DEFINED_IN_PROFILE;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.FIELD_NOT_FOUND;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.HL7_DATATYPE_MISMATCH;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.LENGTH_EXCEEDED;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.LESS_THAN_MINIMUM_CARDINALITY;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.MORE_THAN_MAXIMUM_CARDINALITY;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.NOT_SUPPORTED_ELEMENT_PRESENT;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.NO_ELEMENTS_AFTER_NULL;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.PROFILE_STRUCTURE_MISMATCH;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.PROFILE_STRUCTURE_NOT_EXIST_IN_JAVA_CLASS;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.REQUIRED_ELEMENT_MISSING;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.STRUCTURE_NOT_DEFINED_IN_PROFILE;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.SUBCOMPONENT_TYPE_MISMATCH;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.WRONG_COMPONENT_TYPE;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.WRONG_CONSTANT_VALUE;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.WRONG_FIELD_TYPE;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.*;
import ca.uhn.hl7v2.model.Composite;
import ca.uhn.hl7v2.model.DataTypeException;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.model.Primitive;
import ca.uhn.hl7v2.model.Segment;
import ca.uhn.hl7v2.model.Structure;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.Visitable;
import ca.uhn.hl7v2.model.primitive.TSComponentOne;
import ca.uhn.hl7v2.parser.EncodingCharacters;
import ca.uhn.hl7v2.parser.PipeParser;
import ca.uhn.hl7v2.util.Terser;
import ca.uhn.hl7v2.validation.ValidationException;
import ca.uhn.hl7v2.validation.impl.AbstractMessageRule;
import org.apache.commons.beanutils.BeanUtils;
import org.openehealth.ipf.gazelle.validation.core.stub.HL7V2XConformanceProfile;
import org.openehealth.ipf.gazelle.validation.core.stub.HL7V2XStaticDef;
import org.openehealth.ipf.gazelle.validation.core.stub.SegmentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static org.openehealth.ipf.gazelle.validation.core.util.MessageUtils.*;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileAssertions.profileNotHL7Compliant;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileAssertions.profileViolatedWhen;
import static org.openehealth.ipf.gazelle.validation.core.util.ProfileValidationMessage.*;

/**
* A modified conformance profile validator from HAPI. This implementation differs from HAPI's
* {@link ca.uhn.hl7v2.conf.check.DefaultValidator} and cannot be returned by {@link ca.uhn.hl7v2.HapiContext#getConformanceValidator()}
Expand Down Expand Up @@ -290,11 +315,17 @@ protected List<ValidationException> testField(Type type, SegmentType.Field profi
SegmentType.Field.Component component2;
if (nullContext) {
component2 = new SegmentType.Field.Component();
try {
BeanUtils.copyProperties(component2, component);
} catch (InvocationTargetException | IllegalAccessException e) {
// nop
}
component2.setConstantValue(component.getConstantValue());
component2.setDatatype(component.getDatatype());
component2.getDataValues().addAll(component.getDataValues());
component2.setDescription(component.getDescription());
component2.setImpNote(component.getImpNote());
component2.setLength(component.getLength());
component2.setName(component.getName());
component2.setPredicate(component.getPredicate());
component2.setReference(component.getReference());
component2.getSubComponents().addAll(component.getSubComponents());
component2.setTable(component.getTable());
component2.setUsage("NULL");
} else {
component2 = component;
Expand Down
27 changes: 12 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@
<packaging>pom</packaging>

<properties>
<!-- Project configurations -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<compiler-plugin-version>3.8.1</compiler-plugin-version>
<download-plugin-version>1.6.0</download-plugin-version>
<compiler-plugin-version>3.12.1</compiler-plugin-version>
<download-plugin-version>1.8.0</download-plugin-version>
<gpg-plugin-version>1.6</gpg-plugin-version>
<jar-plugin-version>3.1.0</jar-plugin-version>
<jar-plugin-version>3.3.0</jar-plugin-version>
<javadocs-plugin-version>3.5.0</javadocs-plugin-version>
<nexus-staging-plugin-version>1.6.3</nexus-staging-plugin-version>
<release-plugin-version>2.5.3</release-plugin-version>
<sources-plugin-version>3.0.1</sources-plugin-version>
<surefire-plugin-version>3.0.0-M5</surefire-plugin-version>
<sources-plugin-version>3.3.0</sources-plugin-version>
<surefire-plugin-version>3.2.3</surefire-plugin-version>

<!-- You can set this to true e.g. in CI builds to force downloading the files from the source
instead of accessing them from the cache -->
<skipCache>false</skipCache>

<beanutils-version>1.9.4</beanutils-version>
<commons-io-version>2.11.0</commons-io-version>
<easymock-version>5.0.1</easymock-version>
<commons-io-version>2.15.1</commons-io-version>
<easymock-version>5.2.0</easymock-version>
<hamcrest-version>2.2</hamcrest-version>
<hapi-version>2.3</hapi-version>
<jaxb-version>2.3.4</jaxb-version>
<hapi-version>2.4.1</hapi-version>
<jaxb-version>2.3.9</jaxb-version>
<slf4j-version>1.7.36</slf4j-version>
<junit.jupiter-version>5.8.2</junit.jupiter-version>
</properties>
Expand Down Expand Up @@ -162,11 +164,6 @@
<artifactId>commons-io</artifactId>
<version>${commons-io-version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${beanutils-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
44 changes: 1 addition & 43 deletions profiles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,6 @@
<gazelle-profile-outputdir>${project.build.directory}/gazelle-profiles/org/openehealth/ipf/gazelle/validation/profile/v2</gazelle-profile-outputdir>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>set-ssl-properties</id>
<phase>initialize</phase>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<javax.net.ssl.trustStore>${project.basedir}/../gazelle.jks</javax.net.ssl.trustStore>
<javax.net.ssl.trustStorePassword>initinit</javax.net.ssl.trustStorePassword>
</properties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
System.clearProperty('javax.net.ssl.trustStore')
System.clearProperty('javax.net.ssl.trustStorePassword')
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>

0 comments on commit 71bc5c5

Please sign in to comment.