Skip to content

Commit cb92e82

Browse files
author
Rob Tjalma
authored
Merge pull request #76 from com-pas/remove-jandex
Replace jandex with a beans.xml to start scanning for beans.
2 parents 5df0d1e + e4f66fe commit cb92e82

File tree

19 files changed

+63
-75
lines changed

19 files changed

+63
-75
lines changed
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SPDX-License-Identifier: Apache-2.0
1414
<version>local-SNAPSHOT</version>
1515
</parent>
1616

17-
<artifactId>rest-commons</artifactId>
17+
<artifactId>jaxrs-commons</artifactId>
1818
<packaging>jar</packaging>
1919

2020
<dependencies>
@@ -74,13 +74,4 @@ SPDX-License-Identifier: Apache-2.0
7474
<scope>test</scope>
7575
</dependency>
7676
</dependencies>
77-
78-
<build>
79-
<plugins>
80-
<plugin>
81-
<groupId>org.jboss.jandex</groupId>
82-
<artifactId>jandex-maven-plugin</artifactId>
83-
</plugin>
84-
</plugins>
85-
</build>
8677
</project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
package org.lfenergy.compas.core.jaxrs;
5+
6+
public class JaxrsConstants {
7+
JaxrsConstants() {
8+
throw new UnsupportedOperationException("JaxrsConstants class");
9+
}
10+
11+
public static final String COMPAS_COMMONS_V1_NS_URI = "https://www.lfenergy.org/compas/commons/v1";
12+
}

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/CompasExceptionHandler.java renamed to jaxrs-commons/src/main/java/org/lfenergy/compas/core/jaxrs/exception/CompasExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest.exception;
4+
package org.lfenergy.compas.core.jaxrs.exception;
55

66
import org.lfenergy.compas.core.commons.exception.CompasException;
7-
import org.lfenergy.compas.core.rest.model.ErrorResponse;
7+
import org.lfenergy.compas.core.jaxrs.model.ErrorResponse;
88
import org.slf4j.Logger;
99
import org.slf4j.LoggerFactory;
1010

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/ConstraintViolationExceptionHandler.java renamed to jaxrs-commons/src/main/java/org/lfenergy/compas/core/jaxrs/exception/ConstraintViolationExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest.exception;
4+
package org.lfenergy.compas.core.jaxrs.exception;
55

6-
import org.lfenergy.compas.core.rest.model.ErrorResponse;
6+
import org.lfenergy.compas.core.jaxrs.model.ErrorResponse;
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/GenericExceptionHandler.java renamed to jaxrs-commons/src/main/java/org/lfenergy/compas/core/jaxrs/exception/GenericExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest.exception;
4+
package org.lfenergy.compas.core.jaxrs.exception;
55

6-
import org.lfenergy.compas.core.rest.model.ErrorResponse;
6+
import org.lfenergy.compas.core.jaxrs.model.ErrorResponse;
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99

rest-commons/src/main/java/org/lfenergy/compas/core/rest/model/ErrorMessage.java renamed to jaxrs-commons/src/main/java/org/lfenergy/compas/core/jaxrs/model/ErrorMessage.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest.model;
4+
package org.lfenergy.compas.core.jaxrs.model;
55

66
import javax.xml.bind.annotation.XmlAccessType;
77
import javax.xml.bind.annotation.XmlAccessorType;
88
import javax.xml.bind.annotation.XmlElement;
99

10-
import static org.lfenergy.compas.core.rest.RestConstants.COMPAS_REST_V1_NS_URI;
10+
import static org.lfenergy.compas.core.jaxrs.JaxrsConstants.COMPAS_COMMONS_V1_NS_URI;
1111

1212
@XmlAccessorType(XmlAccessType.FIELD)
1313
public class ErrorMessage {
14-
@XmlElement(name = "Code", namespace = COMPAS_REST_V1_NS_URI, required = true)
14+
@XmlElement(name = "Code", namespace = COMPAS_COMMONS_V1_NS_URI, required = true)
1515
private String code;
16-
@XmlElement(name = "Message", namespace = COMPAS_REST_V1_NS_URI, required = true)
16+
@XmlElement(name = "Message", namespace = COMPAS_COMMONS_V1_NS_URI, required = true)
1717
private String message;
18-
@XmlElement(name = "Property", namespace = COMPAS_REST_V1_NS_URI, required = true)
18+
@XmlElement(name = "Property", namespace = COMPAS_COMMONS_V1_NS_URI, required = true)
1919
private String property;
2020

2121
public ErrorMessage() {

rest-commons/src/main/java/org/lfenergy/compas/core/rest/model/ErrorResponse.java renamed to jaxrs-commons/src/main/java/org/lfenergy/compas/core/jaxrs/model/ErrorResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest.model;
4+
package org.lfenergy.compas.core.jaxrs.model;
55

66
import javax.xml.bind.annotation.XmlAccessType;
77
import javax.xml.bind.annotation.XmlAccessorType;
@@ -10,12 +10,12 @@
1010
import java.util.ArrayList;
1111
import java.util.List;
1212

13-
import static org.lfenergy.compas.core.rest.RestConstants.COMPAS_REST_V1_NS_URI;
13+
import static org.lfenergy.compas.core.jaxrs.JaxrsConstants.COMPAS_COMMONS_V1_NS_URI;
1414

15-
@XmlRootElement(name = "ErrorResponse", namespace = COMPAS_REST_V1_NS_URI)
15+
@XmlRootElement(name = "ErrorResponse", namespace = COMPAS_COMMONS_V1_NS_URI)
1616
@XmlAccessorType(XmlAccessType.FIELD)
1717
public class ErrorResponse {
18-
@XmlElement(name = "ErrorMessage", namespace = COMPAS_REST_V1_NS_URI, required = true)
18+
@XmlElement(name = "ErrorMessage", namespace = COMPAS_COMMONS_V1_NS_URI, required = true)
1919
private List<ErrorMessage> errorMessages = new ArrayList<>();
2020

2121
public void setErrorMessages(List<ErrorMessage> errorMessages) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
@XmlSchema(xmlns = {@XmlNs(prefix = "compas-commons", namespaceURI = COMPAS_COMMONS_V1_NS_URI)})
5+
package org.lfenergy.compas.core.jaxrs.model;
6+
7+
import javax.xml.bind.annotation.XmlNs;
8+
import javax.xml.bind.annotation.XmlSchema;
9+
10+
import static org.lfenergy.compas.core.jaxrs.JaxrsConstants.COMPAS_COMMONS_V1_NS_URI;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2021 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
10+
bean-discovery-mode="annotated" version="2.0">
11+
</beans>

rest-commons/src/test/java/org/lfenergy/compas/core/rest/RestConstantsTest.java renamed to jaxrs-commons/src/test/java/org/lfenergy/compas/core/jaxrs/JaxrsConstantsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// SPDX-FileCopyrightText: 2021 Alliander N.V.
22
//
33
// SPDX-License-Identifier: Apache-2.0
4-
package org.lfenergy.compas.core.rest;
4+
package org.lfenergy.compas.core.jaxrs;
55

66
import org.junit.jupiter.api.Test;
77

88
import static org.junit.jupiter.api.Assertions.assertThrows;
99

10-
class RestConstantsTest {
10+
class JaxrsConstantsTest {
1111
@Test
1212
void constructor_WhenConstructorCalled_ThenShouldThrowExceptionCauseForbidden() {
13-
assertThrows(UnsupportedOperationException.class, RestConstants::new);
13+
assertThrows(UnsupportedOperationException.class, JaxrsConstants::new);
1414
}
1515
}

0 commit comments

Comments
 (0)