diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 0000000..358a043 --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/checkstyle_suppressions.xml b/checkstyle_suppressions.xml new file mode 100644 index 0000000..672ec90 --- /dev/null +++ b/checkstyle_suppressions.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/master-branch-pipeline.yml b/master-branch-pipeline.yml index 500f78e..75106af 100644 --- a/master-branch-pipeline.yml +++ b/master-branch-pipeline.yml @@ -58,7 +58,7 @@ steps: inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' - options: '--settings $(System.DefaultWorkingDirectory)/settings.xml' + options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -P CHECKSTYLE' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.11' jdkArchitectureOption: 'x64' diff --git a/pom.xml b/pom.xml index cf0f1b0..476eb61 100644 --- a/pom.xml +++ b/pom.xml @@ -187,6 +187,14 @@ + + + maven-checkstyle-plugin + 3.2.0 + + true + + @@ -293,6 +301,36 @@ + + CHECKSTYLE + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + false + + + + process-sources + + checkstyle + + + true + ${project.basedir}/checkstyle_suppressions.xml + true + true + true + ${project.basedir}/checkstyle.xml + + + + + + + OWASP_CHECK diff --git a/pull-request-pipeline.yml b/pull-request-pipeline.yml index 4b1db25..99fcc8b 100644 --- a/pull-request-pipeline.yml +++ b/pull-request-pipeline.yml @@ -17,3 +17,4 @@ steps: publishJUnitResults: true testResultsFiles: '**/surefire-reports/TEST-*.xml' goals: 'package' + options: "-P CHECKSTYLE" diff --git a/release-branch-pipeline.yml b/release-branch-pipeline.yml index 5585f4c..d9ec042 100644 --- a/release-branch-pipeline.yml +++ b/release-branch-pipeline.yml @@ -79,7 +79,7 @@ steps: inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' - options: '--settings $(System.DefaultWorkingDirectory)/settings.xml' + options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -P CHECKSTYLE' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.11' jdkArchitectureOption: 'x64' diff --git a/src/main/java/org/fhir/ucum/utils/XmlUtils.java b/src/main/java/org/fhir/ucum/utils/XmlUtils.java index 4053125..faeeca4 100644 --- a/src/main/java/org/fhir/ucum/utils/XmlUtils.java +++ b/src/main/java/org/fhir/ucum/utils/XmlUtils.java @@ -18,6 +18,8 @@ public class XmlUtils { public static Document parseDOM(InputStream stream) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + factory.setXIncludeAware(false); factory.setNamespaceAware(false); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(stream);