|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<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/xsd/maven-4.0.0.xsd"> |
| 3 | + <modelVersion>4.0.0</modelVersion> |
| 4 | + |
| 5 | + <parent> |
| 6 | + <groupId>de.rwth.idsg</groupId> |
| 7 | + <artifactId>ocpp-parent</artifactId> |
| 8 | + <version>0.0.14-SNAPSHOT</version> |
| 9 | + </parent> |
| 10 | + |
| 11 | + <artifactId>ocpp-jaxb</artifactId> |
| 12 | + <packaging>jar</packaging> |
| 13 | + |
| 14 | + <properties> |
| 15 | + <ocpp-1.6-security-schemas-dir>OCPP-1.6_Security_3rd_Edition_schemas</ocpp-1.6-security-schemas-dir> |
| 16 | + <ocpp-2.0.1-schemas-dir>OCPP-2.0.1_part3_JSON_schemas</ocpp-2.0.1-schemas-dir> |
| 17 | + |
| 18 | + <cxf.version>4.0.5</cxf.version> |
| 19 | + </properties> |
| 20 | + |
| 21 | + <build> |
| 22 | + <plugins> |
| 23 | + <plugin> |
| 24 | + <groupId>org.apache.cxf</groupId> |
| 25 | + <artifactId>cxf-codegen-plugin</artifactId> |
| 26 | + <version>${cxf.version}</version> |
| 27 | + <configuration> |
| 28 | + <sourceRoot>${project.build.directory}/generated-sources</sourceRoot> |
| 29 | + <wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot> |
| 30 | + <defaultOptions> |
| 31 | + <bindingFiles> |
| 32 | + <bindingFile>${basedir}/src/main/resources/wsdl-binding/ocpp_binding.xml</bindingFile> |
| 33 | + <bindingFile>${basedir}/src/main/resources/wsdl-binding/async_binding.xml</bindingFile> |
| 34 | + <bindingFile>${basedir}/src/main/resources/wsdl-binding/add_interface.xml</bindingFile> |
| 35 | + </bindingFiles> |
| 36 | + <extraargs> |
| 37 | + <extraarg>-xjc-Xfluent-api</extraarg> |
| 38 | + <extraarg>-xjc-Xinheritance</extraarg> |
| 39 | + <extraarg>-xjc-Xannotate</extraarg> |
| 40 | + <!--<extraarg>-verbose</extraarg>--> |
| 41 | + <extraarg>-exsh</extraarg> |
| 42 | + <extraarg>true</extraarg> |
| 43 | + </extraargs> |
| 44 | + </defaultOptions> |
| 45 | + </configuration> |
| 46 | + <executions> |
| 47 | + <execution> |
| 48 | + <id>generate-sources</id> |
| 49 | + <phase>generate-sources</phase> |
| 50 | + <goals> |
| 51 | + <goal>wsdl2java</goal> |
| 52 | + </goals> |
| 53 | + </execution> |
| 54 | + </executions> |
| 55 | + <dependencies> |
| 56 | + <dependency> |
| 57 | + <groupId>org.projectlombok</groupId> |
| 58 | + <artifactId>lombok</artifactId> |
| 59 | + <version>${lombok.version}</version> |
| 60 | + </dependency> |
| 61 | + <dependency> |
| 62 | + <groupId>org.jvnet.jaxb</groupId> |
| 63 | + <artifactId>jaxb-plugins</artifactId> |
| 64 | + <version>4.0.8</version> |
| 65 | + </dependency> |
| 66 | + <dependency> |
| 67 | + <groupId>org.jvnet.jaxb</groupId> |
| 68 | + <artifactId>jaxb-plugin-annotate</artifactId> |
| 69 | + <version>4.0.8</version> |
| 70 | + </dependency> |
| 71 | + </dependencies> |
| 72 | + </plugin> |
| 73 | + <plugin> |
| 74 | + <groupId>com.google.code.maven-replacer-plugin</groupId> |
| 75 | + <artifactId>replacer</artifactId> |
| 76 | + <version>1.5.3</version> |
| 77 | + <executions> |
| 78 | + |
| 79 | + <!-- Unlike Ocpp 2 schema files, Ocpp 1.6 Security schema files do not use "Request" postfix in name |
| 80 | + for request messages, i.e. they are like InstallCertificate.json instead of InstallCertificateRequest.json. |
| 81 | + This creates a minor problem when selecting/filtering the files to add the interface RequestType. |
| 82 | +
|
| 83 | + Solution: Apply RequestType to all files first. The next execution 'add-response-interface-ocpp-1.6-security' |
| 84 | + will select the Response files only and override the RequestType with the proper ResponseType. |
| 85 | + --> |
| 86 | + <execution> |
| 87 | + <id>add-request-interface-ocpp-1.6j-security</id> |
| 88 | + <phase>generate-resources</phase> |
| 89 | + <goals> |
| 90 | + <goal>replace</goal> |
| 91 | + </goals> |
| 92 | + <configuration> |
| 93 | + <filesToInclude>${basedir}/src/main/resources/${ocpp-1.6-security-schemas-dir}/*.json</filesToInclude> |
| 94 | + <preserveDir>false</preserveDir> |
| 95 | + <outputDir>${project.build.directory}/generated-resources/${ocpp-1.6-security-schemas-dir}</outputDir> |
| 96 | + <replacements> |
| 97 | + <replacement> |
| 98 | + <token>"\$schema"</token> |
| 99 | + <!-- is html code for line break --> |
| 100 | + <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.RequestType"], |
| 101 | + "\$schema"</value> |
| 102 | + </replacement> |
| 103 | + </replacements> |
| 104 | + </configuration> |
| 105 | + </execution> |
| 106 | + <execution> |
| 107 | + <id>add-response-interface-ocpp-1.6j-security</id> |
| 108 | + <phase>generate-resources</phase> |
| 109 | + <goals> |
| 110 | + <goal>replace</goal> |
| 111 | + </goals> |
| 112 | + <configuration> |
| 113 | + <filesToInclude>${basedir}/src/main/resources/${ocpp-1.6-security-schemas-dir}/*Response.json</filesToInclude> |
| 114 | + <preserveDir>false</preserveDir> |
| 115 | + <outputDir>${project.build.directory}/generated-resources/${ocpp-1.6-security-schemas-dir}</outputDir> |
| 116 | + <replacements> |
| 117 | + <replacement> |
| 118 | + <token>"\$schema"</token> |
| 119 | + <!-- is html code for line break --> |
| 120 | + <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.ResponseType"], |
| 121 | + "\$schema"</value> |
| 122 | + </replacement> |
| 123 | + </replacements> |
| 124 | + </configuration> |
| 125 | + </execution> |
| 126 | + |
| 127 | + <execution> |
| 128 | + <id>add-request-interface-ocpp-2.0.1</id> |
| 129 | + <phase>generate-resources</phase> |
| 130 | + <goals> |
| 131 | + <goal>replace</goal> |
| 132 | + </goals> |
| 133 | + <configuration> |
| 134 | + <filesToInclude>${basedir}/src/main/resources/${ocpp-2.0.1-schemas-dir}/*Request.json</filesToInclude> |
| 135 | + <preserveDir>false</preserveDir> |
| 136 | + <outputDir>${project.build.directory}/generated-resources/${ocpp-2.0.1-schemas-dir}</outputDir> |
| 137 | + <replacements> |
| 138 | + <replacement> |
| 139 | + <token>"\$schema"</token> |
| 140 | + <!-- is html code for line break --> |
| 141 | + <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.RequestType"], |
| 142 | + "\$schema"</value> |
| 143 | + </replacement> |
| 144 | + </replacements> |
| 145 | + </configuration> |
| 146 | + </execution> |
| 147 | + <execution> |
| 148 | + <id>add-response-interface-ocpp-2.0.1</id> |
| 149 | + <phase>generate-resources</phase> |
| 150 | + <goals> |
| 151 | + <goal>replace</goal> |
| 152 | + </goals> |
| 153 | + <configuration> |
| 154 | + <filesToInclude>${basedir}/src/main/resources/${ocpp-2.0.1-schemas-dir}/*Response.json</filesToInclude> |
| 155 | + <preserveDir>false</preserveDir> |
| 156 | + <outputDir>${project.build.directory}/generated-resources/${ocpp-2.0.1-schemas-dir}</outputDir> |
| 157 | + <replacements> |
| 158 | + <replacement> |
| 159 | + <token>"\$schema"</token> |
| 160 | + <!-- is html code for line break --> |
| 161 | + <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.ResponseType"], |
| 162 | + "\$schema"</value> |
| 163 | + </replacement> |
| 164 | + </replacements> |
| 165 | + </configuration> |
| 166 | + </execution> |
| 167 | + </executions> |
| 168 | + </plugin> |
| 169 | + <plugin> |
| 170 | + <groupId>org.jsonschema2pojo</groupId> |
| 171 | + <artifactId>jsonschema2pojo-maven-plugin</artifactId> |
| 172 | + <version>${jsonschema2pojo.version}</version> |
| 173 | + <configuration> |
| 174 | + <outputDirectory>${project.build.directory}/generated-sources</outputDirectory> |
| 175 | + <generateBuilders>true</generateBuilders> |
| 176 | + <includeJsr303Annotations>true</includeJsr303Annotations> |
| 177 | + <includeGeneratedAnnotation>false</includeGeneratedAnnotation> |
| 178 | + <useJakartaValidation>true</useJakartaValidation> |
| 179 | + <useJodaDates>true</useJodaDates> |
| 180 | + <useJodaLocalDates>true</useJodaLocalDates> |
| 181 | + <useJodaLocalTimes>true</useJodaLocalTimes> |
| 182 | + </configuration> |
| 183 | + <executions> |
| 184 | + <execution> |
| 185 | + <id>generate-ocpp-1.6j-security</id> |
| 186 | + <phase>process-resources</phase> |
| 187 | + <goals> |
| 188 | + <goal>generate</goal> |
| 189 | + </goals> |
| 190 | + <configuration> |
| 191 | + <sourceDirectory>${project.build.directory}/generated-resources/${ocpp-1.6-security-schemas-dir}</sourceDirectory> |
| 192 | + <!-- using the date of "OCPP 1.6 security whitepaper edition 3" as package--> |
| 193 | + <targetPackage>ocpp._2022._02.security</targetPackage> |
| 194 | + <customDateTimePattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</customDateTimePattern> |
| 195 | + </configuration> |
| 196 | + </execution> |
| 197 | + <execution> |
| 198 | + <id>generate-ocpp-2.0.1</id> |
| 199 | + <phase>process-resources</phase> |
| 200 | + <goals> |
| 201 | + <goal>generate</goal> |
| 202 | + </goals> |
| 203 | + <configuration> |
| 204 | + <sourceDirectory>${project.build.directory}/generated-resources/${ocpp-2.0.1-schemas-dir}</sourceDirectory> |
| 205 | + <targetPackage>ocpp._2020._03</targetPackage> |
| 206 | + <customDateTimePattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</customDateTimePattern> |
| 207 | + </configuration> |
| 208 | + </execution> |
| 209 | + </executions> |
| 210 | + </plugin> |
| 211 | + </plugins> |
| 212 | + </build> |
| 213 | + |
| 214 | + <dependencies> |
| 215 | + <dependency> |
| 216 | + <groupId>${project.groupId}</groupId> |
| 217 | + <artifactId>ocpp-custom</artifactId> |
| 218 | + </dependency> |
| 219 | + |
| 220 | + <dependency> |
| 221 | + <groupId>jakarta.validation</groupId> |
| 222 | + <artifactId>jakarta.validation-api</artifactId> |
| 223 | + </dependency> |
| 224 | + <dependency> |
| 225 | + <groupId>jakarta.xml.soap</groupId> |
| 226 | + <artifactId>jakarta.xml.soap-api</artifactId> |
| 227 | + </dependency> |
| 228 | + <dependency> |
| 229 | + <groupId>jakarta.jws</groupId> |
| 230 | + <artifactId>jakarta.jws-api</artifactId> |
| 231 | + </dependency> |
| 232 | + <dependency> |
| 233 | + <groupId>jakarta.xml.bind</groupId> |
| 234 | + <artifactId>jakarta.xml.bind-api</artifactId> |
| 235 | + </dependency> |
| 236 | + <dependency> |
| 237 | + <groupId>jakarta.xml.ws</groupId> |
| 238 | + <artifactId>jakarta.xml.ws-api</artifactId> |
| 239 | + </dependency> |
| 240 | + <dependency> |
| 241 | + <groupId>joda-time</groupId> |
| 242 | + <artifactId>joda-time</artifactId> |
| 243 | + </dependency> |
| 244 | + <dependency> |
| 245 | + <groupId>org.projectlombok</groupId> |
| 246 | + <artifactId>lombok</artifactId> |
| 247 | + </dependency> |
| 248 | + |
| 249 | + <dependency> |
| 250 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 251 | + <artifactId>jackson-annotations</artifactId> |
| 252 | + </dependency> |
| 253 | + |
| 254 | + <dependency> |
| 255 | + <groupId>org.junit.jupiter</groupId> |
| 256 | + <artifactId>junit-jupiter-engine</artifactId> |
| 257 | + <version>5.10.3</version> |
| 258 | + <scope>test</scope> |
| 259 | + </dependency> |
| 260 | + <dependency> |
| 261 | + <groupId>org.junit.jupiter</groupId> |
| 262 | + <artifactId>junit-jupiter-params</artifactId> |
| 263 | + <version>5.10.3</version> |
| 264 | + <scope>test</scope> |
| 265 | + </dependency> |
| 266 | + <dependency> |
| 267 | + <groupId>tools.jackson.datatype</groupId> |
| 268 | + <artifactId>jackson-datatype-joda</artifactId> |
| 269 | + <version>3.0.2</version> |
| 270 | + <scope>test</scope> |
| 271 | + </dependency> |
| 272 | + </dependencies> |
| 273 | +</project> |
0 commit comments