Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<module>steve</module>
<module>steve-api</module>
<module>steve-core</module>
<module>steve-gateway/steve-oicp</module>
<module>steve-jooq</module>
<module>steve-ocpp</module>
<module>steve-ocpp-1-x</module>
Expand Down Expand Up @@ -313,7 +314,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.46.1</version>
<configuration>
<formats>
<format>
Expand Down
114 changes: 114 additions & 0 deletions steve-gateway/steve-oicp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>steve-oicp</artifactId>

<dependencies>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<!--dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
</dependency-->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.38</version>
</dependency>
Comment on lines +36 to +43
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove duplicated Swagger annotations dependency.

Both swagger-annotations-jakarta and swagger-annotations ship the exact same classes (io.swagger.v3.oas.annotations.*). With the global <banDuplicateClasses findAllDuplicates="true"/>, the build will now fail. Keep only the Jakarta artifact (needed for Spring Boot 3) and drop the vanilla swagger-annotations.

🤖 Prompt for AI Agents
In steve-gateway/steve-oicp/pom.xml around lines 36 to 43, there is a duplicated
Swagger annotations dependency causing duplicate-class failures; remove the
<dependency> block for io.swagger.core.v3:swagger-annotations (the non-Jakarta
artifact) and keep only the swagger-annotations-jakarta dependency required for
Spring Boot 3, updating the pom so only the jakarta artifact remains and no
duplicate classes are declared.

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.16.0</version>
<executions>
<execution>
<id>generate-cpo-server</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/OICP_EMP_2.3_API.yaml</inputSpec>
<output>${project.build.directory}/generated-sources/oicp-emp-2.3</output>
<generatorName>spring</generatorName>

<apiPackage>de.rwth.idsg.steve.gateway.oicp.controller</apiPackage>
<modelPackage>de.rwth.idsg.steve.gateway.oicp.model.cpo</modelPackage>

<generateSupportingFiles>false</generateSupportingFiles>
<skipValidateSpec>true</skipValidateSpec>

<configOptions>
<useSpringBoot3>true</useSpringBoot3>
<documentationProvider>none</documentationProvider>
<openApiNullable>false</openApiNullable>
<interfaceOnly>true</interfaceOnly>
<useTags>true</useTags>
<skipDefaultInterface>true</skipDefaultInterface>
<additionalModelTypeAnnotations>@lombok.Data @lombok.AllArgsConstructor @lombok.Builder</additionalModelTypeAnnotations>
</configOptions>
</configuration>
</execution>
<execution>
<id>generate-emp-client</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/OICP_CPO_2.3_API.yaml</inputSpec>
<output>${project.build.directory}/generated-sources/oicp-cpo-2.3</output>
<generatorName>java</generatorName>

<apiPackage>de.rwth.idsg.steve.gateway.oicp.client</apiPackage>
<modelPackage>de.rwth.idsg.steve.gateway.oicp.model.emp</modelPackage>

<!--generateSupportingFiles>false</generateSupportingFiles-->
<skipValidateSpec>true</skipValidateSpec>

<configOptions>
<library>restclient</library>
<generateClientAsBean>true</generateClientAsBean>
<documentationProvider>none</documentationProvider>
<openApiNullable>false</openApiNullable>
<additionalModelTypeAnnotations>@lombok.Data @lombok.AllArgsConstructor @lombok.Builder</additionalModelTypeAnnotations>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SteVe - SteckdosenVerwaltung - https://github.com/steve-community/steve
* Copyright (C) 2013-2025 SteVe Community Team
* All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.rwth.idsg.steve.gateway.oicp;

import de.rwth.idsg.steve.gateway.oicp.model.cpo.StatusCode;
import org.springframework.http.ResponseEntity;

import java.util.Optional;

public class OicpResponse {
public static <T> ResponseEntity<T> toResponse(T data) {
return ResponseEntity.of(Optional.of(data));
}

public static StatusCode successCode() {
return StatusCode.builder().code("000").description("Success").build();
}

public static StatusCode errorCode(String statusCode, String message) {
return StatusCode.builder().code(statusCode).description(message).build();
}
}
Loading
Loading