Skip to content

Commit 6947d21

Browse files
authored
Merge pull request #192 from rosette-api/no-jira-11.0-parent-pom-upgrade
WS-2609: Migration to a newer parent pom.
2 parents 5b3e2f9 + 9e5153d commit 6947d21

File tree

68 files changed

+922
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+922
-692
lines changed

CI.Jenkinsfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
node ("docker-light") {
2+
def sourceDir = pwd()
3+
try {
4+
stage("Clean up") {
5+
step([$class: 'WsCleanup'])
6+
}
7+
stage("Checkout Code") {
8+
checkout scm
9+
}
10+
stage("Maven Build") {
11+
withSonarQubeEnv {
12+
sh "docker run --rm \
13+
--pull always \
14+
--volume ${sourceDir}:/source \
15+
--volume /opt/maven-basis:/opt/maven-basis \
16+
eclipse-temurin:17-jdk-focal \
17+
bash -c \"apt-get update && \
18+
apt-get install -y git && \
19+
pushd /source && \
20+
/opt/maven-basis/bin/mvn --batch-mode clean install && \
21+
/opt/maven-basis/bin/mvn --batch-mode sonar:sonar \
22+
-Dsonar.login=${env.SONAR_AUTH_TOKEN} \
23+
-Dsonar.host.url=${env.SONAR_HOST_URL} \
24+
-Dsonar.pullrequest.key=${env.CHANGE_ID} \
25+
-Dsonar.pullrequest.base=${env.CHANGE_TARGET} \
26+
-Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}\""
27+
}
28+
}
29+
slack(true)
30+
} catch (e) {
31+
currentBuild.result = "FAILED"
32+
slack(false)
33+
throw e
34+
}
35+
}
36+
37+
def slack(boolean success) {
38+
def color = success ? "#00FF00" : "#FF0000"
39+
def status = success ? "SUCCESSFUL" : "FAILED"
40+
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
41+
slackSend(color: color, channel: "#p-n-c_jenkins", message: message)
42+
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
---
44

5-
[![Build Status](https://travis-ci.org/rosette-api/java.svg?branch=master)](https://travis-ci.org/rosette-api/java)
65
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.basistech.rosette/rosette-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.basistech.rosette/rosette-api-java-binding)
76

87
## Rosette API

annotations/src/main/java/com/basistech/rosette/annotations/JacksonMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2022 Basis Technology Corp.
2+
* Copyright 2017 Basis Technology Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

annotations/src/main/java/com/basistech/rosette/annotations/JacksonMixinProcessor.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Basis Technology Corp.
2+
* Copyright 2022 Basis Technology Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,6 +48,7 @@
4848
public class JacksonMixinProcessor extends AbstractProcessor {
4949

5050
private static final String PACKAGE_NAME = "com.basistech.rosette.apimodel.jackson";
51+
private static final String VALUE = "value";
5152

5253
private ProcessingEnvironment processingEnvironment;
5354

@@ -58,6 +59,7 @@ public synchronized void init(ProcessingEnvironment processingEnvironment) {
5859
}
5960

6061
@Override
62+
@SuppressWarnings("java:S3516") // From the Javadoc: "A processor may always return the same boolean value..."
6163
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment) {
6264
if (roundEnvironment.getElementsAnnotatedWith(JacksonMixin.class).isEmpty()) {
6365
return true;
@@ -76,14 +78,14 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
7678
.classBuilder(typeElement.getSimpleName().toString() + "Mixin")
7779
.addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
7880
.addAnnotation(AnnotationSpec.builder(JsonTypeName.class)
79-
.addMember("value", "$S", typeElement.getSimpleName())
81+
.addMember(VALUE, "$S", typeElement.getSimpleName())
8082
.build())
8183
.addAnnotation(AnnotationSpec.builder(JsonDeserialize.class)
8284
.addMember("builder", CodeBlock.builder()
8385
.add(elementQualifiedName + "." + elementSimpleName + "Builder.class").build())
8486
.build())
8587
.addAnnotation(AnnotationSpec.builder(JsonInclude.class)
86-
.addMember("value", CodeBlock.builder()
88+
.addMember(VALUE, CodeBlock.builder()
8789
.add("JsonInclude.Include.NON_NULL").build())
8890
.build())
8991
.addType(TypeSpec
@@ -119,7 +121,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
119121
.classBuilder("MixinUtil")
120122
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
121123
.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class)
122-
.addMember("value", "$S", "PMD")
124+
.addMember(VALUE, "$S", "PMD")
123125
.build())
124126
.addMethod(methodSpecBuilder.build());
125127
try {

api/pom.xml

Lines changed: 40 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2018 Basis Technology Corp.
3+
Copyright 2018-2022 Basis Technology Corp.
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -51,15 +51,41 @@
5151
<groupId>com.fasterxml.jackson.core</groupId>
5252
<artifactId>jackson-databind</artifactId>
5353
</dependency>
54+
<!-- Declaring explicitly as 4.5.x httpclient brings in an old version. -->
55+
<dependency>
56+
<groupId>commons-codec</groupId>
57+
<artifactId>commons-codec</artifactId>
58+
<version>${commons-codec.version}</version>
59+
</dependency>
5460
<dependency>
5561
<groupId>org.apache.httpcomponents</groupId>
5662
<artifactId>httpclient</artifactId>
5763
<version>${http-components.version}</version>
64+
<exclusions>
65+
<exclusion>
66+
<groupId>commons-codec</groupId>
67+
<artifactId>commons-codec</artifactId>
68+
</exclusion>
69+
</exclusions>
5870
</dependency>
5971
<dependency>
6072
<groupId>org.apache.httpcomponents</groupId>
6173
<artifactId>httpclient-osgi</artifactId>
6274
<version>${http-components.version}</version>
75+
<exclusions>
76+
<exclusion>
77+
<groupId>org.apache.httpcomponents</groupId>
78+
<artifactId>httpclient</artifactId>
79+
</exclusion>
80+
<exclusion>
81+
<groupId>org.apache.httpcomponents</groupId>
82+
<artifactId>httpmime</artifactId>
83+
</exclusion>
84+
<exclusion>
85+
<groupId>commons-codec</groupId>
86+
<artifactId>commons-codec</artifactId>
87+
</exclusion>
88+
</exclusions>
6389
</dependency>
6490
<dependency>
6591
<groupId>org.apache.httpcomponents</groupId>
@@ -70,30 +96,32 @@
7096
<groupId>org.apache.httpcomponents</groupId>
7197
<artifactId>httpmime</artifactId>
7298
<version>${http-components.version}</version>
99+
<exclusions>
100+
<exclusion>
101+
<groupId>org.apache.httpcomponents</groupId>
102+
<artifactId>httpclient</artifactId>
103+
</exclusion>
104+
</exclusions>
73105
</dependency>
74106
<dependency>
75107
<groupId>org.slf4j</groupId>
76108
<artifactId>slf4j-api</artifactId>
77109
</dependency>
78110
<dependency>
79-
<groupId>junit</groupId>
80-
<artifactId>junit</artifactId>
81-
</dependency>
82-
<dependency>
83-
<groupId>org.mock-server</groupId>
84-
<artifactId>mockserver-client-java</artifactId>
85-
<version>${mockserver.version}</version>
111+
<groupId>org.junit.jupiter</groupId>
112+
<artifactId>junit-jupiter-api</artifactId>
113+
<version>${junit.version}</version>
86114
<scope>test</scope>
87115
</dependency>
88116
<dependency>
89-
<groupId>org.mock-server</groupId>
90-
<artifactId>mockserver-core</artifactId>
91-
<version>${mockserver.version}</version>
117+
<groupId>org.junit.jupiter</groupId>
118+
<artifactId>junit-jupiter-params</artifactId>
119+
<version>${junit.version}</version>
92120
<scope>test</scope>
93121
</dependency>
94122
<dependency>
95123
<groupId>org.mock-server</groupId>
96-
<artifactId>mockserver-netty</artifactId>
124+
<artifactId>mockserver-junit-jupiter-no-dependencies</artifactId>
97125
<version>${mockserver.version}</version>
98126
<scope>test</scope>
99127
</dependency>
@@ -118,57 +146,9 @@
118146
</archive>
119147
</configuration>
120148
</plugin>
121-
<plugin>
122-
<groupId>org.codehaus.mojo</groupId>
123-
<artifactId>build-helper-maven-plugin</artifactId>
124-
<version>${build-helper-maven-plugin.version}</version>
125-
<executions>
126-
<execution>
127-
<id>reserve-network-port</id>
128-
<goals>
129-
<goal>reserve-network-port</goal>
130-
</goals>
131-
<phase>initialize</phase>
132-
<configuration>
133-
<portNames>
134-
<portName>mockServerClient.port</portName>
135-
</portNames>
136-
</configuration>
137-
</execution>
138-
</executions>
139-
</plugin>
140-
<plugin>
141-
<groupId>org.mock-server</groupId>
142-
<artifactId>mockserver-maven-plugin</artifactId>
143-
<version>${mockserver.version}</version>
144-
<configuration>
145-
<serverPort>${mockServerClient.port}</serverPort>
146-
<logLevel>WARN</logLevel>
147-
<skip>${skip-mockserver}</skip>
148-
</configuration>
149-
<executions>
150-
<execution>
151-
<id>process-test-classes</id>
152-
<phase>process-test-classes</phase>
153-
<goals>
154-
<goal>runForked</goal>
155-
</goals>
156-
</execution>
157-
<execution>
158-
<id>verify</id>
159-
<phase>verify</phase>
160-
<goals>
161-
<goal>stopForked</goal>
162-
</goals>
163-
</execution>
164-
</executions>
165-
</plugin>
166149
<plugin>
167150
<groupId>org.apache.maven.plugins</groupId>
168151
<artifactId>maven-surefire-plugin</artifactId>
169-
<configuration>
170-
<argLine>-Xmx1024m</argLine>
171-
</configuration>
172152
</plugin>
173153
</plugins>
174154
<resources>
@@ -181,13 +161,6 @@
181161
</resource>
182162
</resources>
183163
<testResources>
184-
<testResource>
185-
<directory>src/test/resources</directory>
186-
<includes>
187-
<include>**/*.property</include>
188-
</includes>
189-
<filtering>true</filtering>
190-
</testResource>
191164
<testResource>
192165
<directory>src/test/resources</directory>
193166
<includes>
@@ -199,24 +172,4 @@
199172
</testResource>
200173
</testResources>
201174
</build>
202-
<profiles>
203-
<profile>
204-
<id>skip-mockserver-tests</id>
205-
<properties>
206-
<skip-mockserver>true</skip-mockserver>
207-
</properties>
208-
<build>
209-
<pluginManagement>
210-
<plugins>
211-
<plugin>
212-
<artifactId>maven-surefire-plugin</artifactId>
213-
<configuration>
214-
<skip>true</skip>
215-
</configuration>
216-
</plugin>
217-
</plugins>
218-
</pluginManagement>
219-
</build>
220-
</profile>
221-
</profiles>
222175
</project>

api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2022 Basis Technology Corp.
2+
* Copyright 2022 Basis Technology Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -177,6 +177,7 @@ private static byte[] getBytes(InputStream is) throws IOException {
177177
}
178178
}
179179

180+
@SuppressWarnings("java:HttpClient_must_be_closed") // This library requires keeping the connection open.
180181
private void initClient(String key, List<Header> additionalHeaders) {
181182
HttpClientBuilder builder = HttpClients.custom();
182183
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();

api/src/test/java/com/basistech/rosette/api/AbstractTest.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)