Skip to content

Commit de39fd3

Browse files
committed
update dependencies
1 parent 5c5cfd1 commit de39fd3

File tree

6 files changed

+49
-29
lines changed

6 files changed

+49
-29
lines changed

.github/workflows/maven-v1.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ jobs:
3131
- name: Build with Maven, Deploy snapshot to maven central
3232
run: |
3333
mvn --no-transfer-progress -B verify --file pom.xml
34-
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
35-
echo "POM VERSION" ${MY_POM_VERSION}
36-
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
34+
export MY_JAVA_VERSION=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1`
35+
echo "JAVA VERSION" ${MY_JAVA_VERSION}
36+
if [[ ${MY_JAVA_VERSION} == "8" ]];
3737
then
38-
mvn --no-transfer-progress -B clean deploy
38+
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
39+
echo "POM VERSION" ${MY_POM_VERSION}
40+
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
41+
then
42+
mvn --no-transfer-progress -B clean deploy
43+
else
44+
echo "not deploying release: " ${MY_POM_VERSION}
45+
fi
3946
else
40-
echo "not deploying release: " ${MY_POM_VERSION}
47+
echo "not deploying on java version: " ${MY_JAVA_VERSION}
4148
fi
4249
env:
4350
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.github/workflows/next-snapshot-v1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
uses: actions/setup-python@v2
2121
with:
2222
python-version: 2.7
23-
- name: Set up Java 8
23+
- name: Set up Java 11
2424
uses: actions/setup-java@v1
2525
with:
26-
java-version: 8
26+
java-version: 11
2727
server-id: ossrh
2828
server-username: MAVEN_USERNAME
2929
server-password: MAVEN_PASSWORD

modules/swagger-compat-spec-parser/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<dependency>
6363
<groupId>org.apache.httpcomponents</groupId>
6464
<artifactId>httpclient</artifactId>
65-
<version>4.5.13</version>
65+
<version>4.5.14</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>org.jmockit</groupId>

modules/swagger-parser/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<plugins>
1919
<plugin>
2020
<artifactId>maven-surefire-plugin</artifactId>
21+
<version>${surefire-version}</version>
2122
<configuration>
2223
<groups>single</groups>
2324
<workingDirectory>.</workingDirectory>

modules/swagger-parser/src/main/java/io/swagger/parser/util/DeserializationUtils.java

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,29 @@ public static org.yaml.snakeyaml.Yaml buildSnakeYaml(BaseConstructor constructor
189189
return new org.yaml.snakeyaml.Yaml(constructor);
190190
}
191191
try {
192-
LoaderOptions loaderOptions = new LoaderOptions();
192+
LoaderOptions loaderOptions = buildLoaderOptions();
193+
org.yaml.snakeyaml.Yaml yaml = new org.yaml.snakeyaml.Yaml(constructor, new Representer(new DumperOptions()), new DumperOptions(), loaderOptions, new CustomResolver());
194+
return yaml;
195+
} catch (Exception e) {
196+
//
197+
LOGGER.error("error building snakeYaml", e);
198+
}
199+
return new org.yaml.snakeyaml.Yaml(constructor);
200+
}
201+
202+
public static LoaderOptions buildLoaderOptions() {
203+
LoaderOptions loaderOptions = new LoaderOptions();
204+
try {
193205
Method method = LoaderOptions.class.getMethod("setMaxAliasesForCollections", int.class);
194206
method.invoke(loaderOptions, options.getMaxYamlAliasesForCollections());
195207
method = LoaderOptions.class.getMethod("setAllowRecursiveKeys", boolean.class);
196208
method.invoke(loaderOptions, options.isYamlAllowRecursiveKeys());
197-
org.yaml.snakeyaml.Yaml yaml = new org.yaml.snakeyaml.Yaml(constructor, new Representer(), new DumperOptions(), loaderOptions, new CustomResolver());
198-
return yaml;
199209
} catch (ReflectiveOperationException e) {
200-
//
201210
LOGGER.debug("using snakeyaml < 1.25, not setting YAML Billion Laughs Attack snakeyaml level protection");
202211
}
203-
return new org.yaml.snakeyaml.Yaml(constructor);
212+
return loaderOptions;
204213
}
205214

206-
207215
public static JsonNode readYamlTree(String contents, SwaggerDeserializationResult errorOutput) throws IOException {
208216

209217
if (!options.isSupportYamlAnchors()) {
@@ -214,7 +222,7 @@ public static JsonNode readYamlTree(String contents, SwaggerDeserializationResul
214222
if (options.isValidateYamlInput()) {
215223
yaml = buildSnakeYaml(new CustomSnakeYamlConstructor());
216224
} else {
217-
yaml = buildSnakeYaml(new SafeConstructor());
225+
yaml = buildSnakeYaml(new SafeConstructor(buildLoaderOptions()));
218226
}
219227

220228
Object o = yaml.load(contents);
@@ -358,6 +366,9 @@ public SnakeException(String message, Throwable cause) {
358366

359367
static class CustomSnakeYamlConstructor extends SafeConstructor {
360368

369+
public CustomSnakeYamlConstructor() {
370+
super(buildLoaderOptions());
371+
}
361372
private boolean checkNode(MappingNode node, Integer depth) {
362373
if (node.getValue() == null) return true;
363374
if (depth > options.getMaxYamlDepth()) return false;

pom.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<plugin>
111111
<groupId>org.apache.maven.plugins</groupId>
112112
<artifactId>maven-jar-plugin</artifactId>
113-
<version>2.4</version>
113+
<version>3.3.0</version>
114114
<configuration>
115115
<excludes>
116116
<exclude>**/logback.xml</exclude>
@@ -127,7 +127,7 @@
127127
</plugin>
128128
<plugin>
129129
<artifactId>maven-compiler-plugin</artifactId>
130-
<version>3.5</version>
130+
<version>3.10.1</version>
131131
<configuration>
132132
<source>1.8</source>
133133
<target>1.8</target>
@@ -136,7 +136,7 @@
136136
<plugin>
137137
<groupId>org.apache.maven.plugins</groupId>
138138
<artifactId>maven-javadoc-plugin</artifactId>
139-
<version>2.7</version>
139+
<version>3.5.0</version>
140140
<configuration>
141141
<aggregate>true</aggregate>
142142
<source>1.7</source>
@@ -159,7 +159,7 @@
159159
<plugin>
160160
<groupId>org.apache.maven.plugins</groupId>
161161
<artifactId>maven-source-plugin</artifactId>
162-
<version>2.1.2</version>
162+
<version>3.2.1</version>
163163
<executions>
164164
<execution>
165165
<id>attach-sources</id>
@@ -173,7 +173,7 @@
173173
<plugin>
174174
<groupId>org.jacoco</groupId>
175175
<artifactId>jacoco-maven-plugin</artifactId>
176-
<version>0.7.5.201505241946</version>
176+
<version>0.8.8</version>
177177
<executions>
178178
<execution>
179179
<id>default-prepare-agent</id>
@@ -206,7 +206,7 @@
206206
<plugin>
207207
<groupId>org.apache.maven.plugins</groupId>
208208
<artifactId>maven-enforcer-plugin</artifactId>
209-
<version>3.0.0-M2</version>
209+
<version>3.2.1</version>
210210
<executions>
211211
<execution>
212212
<id>enforce-no-snapshots</id>
@@ -228,7 +228,7 @@
228228
<plugin>
229229
<groupId>org.sonatype.plugins</groupId>
230230
<artifactId>nexus-staging-maven-plugin</artifactId>
231-
<version>1.6.8</version>
231+
<version>1.6.13</version>
232232
<extensions>true</extensions>
233233
<configuration>
234234
<serverId>ossrh</serverId>
@@ -258,7 +258,7 @@
258258
<plugin>
259259
<groupId>org.apache.maven.plugins</groupId>
260260
<artifactId>maven-enforcer-plugin</artifactId>
261-
<version>3.0.0-M2</version>
261+
<version>3.2.1</version>
262262
</plugin>
263263
</plugins>
264264
</pluginManagement>
@@ -391,15 +391,16 @@
391391
</repository>
392392
</repositories>
393393
<properties>
394+
<!--<maven.compiler.release>8</maven.compiler.release>-->
394395
<commons-io-version>2.11.0</commons-io-version>
395-
<snakeyaml-version>1.33</snakeyaml-version>
396-
<slf4j-version>1.7.28</slf4j-version>
397-
<swagger-core-version>1.6.9</swagger-core-version>
398-
<junit-version>4.13.1</junit-version>
396+
<snakeyaml-version>2.0</snakeyaml-version>
397+
<slf4j-version>1.7.36</slf4j-version>
398+
<swagger-core-version>1.6.10</swagger-core-version>
399+
<junit-version>4.13.2</junit-version>
399400
<testng-version>6.9.6</testng-version>
400401
<jmockit-version>1.19</jmockit-version>
401-
<wiremock-version>2.25.0</wiremock-version>
402-
<surefire-version>2.18.1</surefire-version>
402+
<wiremock-version>2.27.2</wiremock-version>
403+
<surefire-version>2.22.2</surefire-version>
403404
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
404405
<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
405406
</properties>

0 commit comments

Comments
 (0)