Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve version management, update dependencies, remove unused dependencies #10544

Merged
merged 30 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a104403
Move verion properties to main pom.xml
agilob Oct 6, 2021
d1d4b6b
Sort properties and remove duplicates
agilob Oct 6, 2021
90b2b5d
Use properties for known versions
agilob Oct 6, 2021
accf625
Deduplicate versions of maven plugins
agilob Oct 6, 2021
02bccd0
Deduplicate wagon dependencies
agilob Oct 6, 2021
48a2b84
Deduplicate maven targer and source properties
agilob Oct 6, 2021
0d5d488
Explicitly set testng version
agilob Oct 6, 2021
bd5fb33
Remove property used once
agilob Oct 6, 2021
9137cf0
Sort lines
agilob Oct 6, 2021
758c325
Standardise name of maven version properties
agilob Oct 6, 2021
dd91a91
Upgrade maven-surefire-plugin
agilob Oct 6, 2021
62afe55
Comment out jackson-datatype-jsr310
agilob Oct 6, 2021
a6adf84
Comment out com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile
agilob Oct 6, 2021
24e0992
Remove commented out dependencies
agilob Oct 6, 2021
80a140f
Rename maven param name
agilob Oct 6, 2021
496c39a
Remove org.hamcrest:java-hamcrest:jar:2.0.0.0:test
agilob Oct 6, 2021
86a3968
Bump jacoco
agilob Oct 6, 2021
d6bd363
Upgrade guava, replace deprecated or removed api with vanilla java
agilob Oct 6, 2021
08e8682
Bump jmustache.version
agilob Oct 6, 2021
e18fe8a
Bump jackson.version
agilob Oct 6, 2021
918138c
Bump jackson.version and mockito
agilob Oct 6, 2021
ba674b6
Bump testng
agilob Oct 6, 2021
6a55368
Bump wagon-ssh-external.version
agilob Oct 6, 2021
679d0a2
Downgrade jmustache
agilob Oct 6, 2021
55e3fa8
Bump spring boot version and add junit
agilob Oct 6, 2021
4fcef4f
Bump maven in wrapper
agilob Oct 6, 2021
e6371d9
Bump apache libs
agilob Oct 6, 2021
01d5442
Bump dependencies
agilob Oct 6, 2021
e943ed8
Revert checkstyle bump
agilob Oct 6, 2021
48de9a5
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Oct 9, 2021
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 .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
5 changes: 3 additions & 2 deletions modules/openapi-generator-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand Down Expand Up @@ -144,13 +145,13 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<!-- <version>${testng-version}</version> -->
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 3 additions & 7 deletions modules/openapi-generator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava-version}</version>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-version}</version>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -70,9 +71,4 @@
</build>
</profile>
</profiles>

<properties>
<slf4j-version>1.7.29</slf4j-version>
<guava-version>26.0-jre</guava-version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package org.openapitools.codegen.config;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -48,13 +46,13 @@ public final class GeneratorSettings implements Serializable {
private String artifactVersion;
private String library;

private final ImmutableMap<String, String> instantiationTypes;
private final ImmutableMap<String, String> typeMappings;
private final ImmutableMap<String, Object> additionalProperties;
private final ImmutableMap<String, String> importMappings;
private final ImmutableSet<String> languageSpecificPrimitives;
private final ImmutableMap<String, String> reservedWordMappings;
private final ImmutableMap<String, String> serverVariables;
private final Map<String, String> instantiationTypes;
private final Map<String, String> typeMappings;
private final Map<String, Object> additionalProperties;
private final Map<String, String> importMappings;
private final Set<String> languageSpecificPrimitives;
private final Map<String, String> reservedWordMappings;
private final Map<String, String> serverVariables;

private String gitHost;
private String gitUserId;
Expand Down Expand Up @@ -348,12 +346,12 @@ private GeneratorSettings(Builder builder) {
artifactId = builder.artifactId;
artifactVersion = builder.artifactVersion;
library = builder.library;
instantiationTypes = ImmutableMap.copyOf(builder.instantiationTypes);
typeMappings = ImmutableMap.copyOf(builder.typeMappings);
importMappings = ImmutableMap.copyOf(builder.importMappings);
languageSpecificPrimitives = ImmutableSet.copyOf(builder.languageSpecificPrimitives);
reservedWordMappings = ImmutableMap.copyOf(builder.reservedWordMappings);
serverVariables = ImmutableMap.copyOf(builder.serverVariables);
instantiationTypes = Collections.unmodifiableMap(builder.instantiationTypes);
typeMappings = Collections.unmodifiableMap(builder.typeMappings);
importMappings = Collections.unmodifiableMap(builder.importMappings);
languageSpecificPrimitives = Collections.unmodifiableSet(builder.languageSpecificPrimitives);
reservedWordMappings = Collections.unmodifiableMap(builder.reservedWordMappings);
serverVariables = Collections.unmodifiableMap(builder.serverVariables);
gitHost = builder.gitHost;
gitUserId = builder.gitUserId;
gitRepoId = builder.gitRepoId;
Expand Down Expand Up @@ -408,7 +406,7 @@ private GeneratorSettings(Builder builder) {
additional.put("httpUserAgent", httpUserAgent);
}

additionalProperties = ImmutableMap.copyOf(additional);
additionalProperties = Collections.unmodifiableMap(additional);
}

/**
Expand All @@ -417,13 +415,13 @@ private GeneratorSettings(Builder builder) {
@SuppressWarnings("unused")
public GeneratorSettings() {
setDefaults();
instantiationTypes = ImmutableMap.of();
typeMappings = ImmutableMap.of();
additionalProperties = ImmutableMap.of();
importMappings = ImmutableMap.of();
languageSpecificPrimitives = ImmutableSet.of();
reservedWordMappings = ImmutableMap.of();
serverVariables = ImmutableMap.of();
instantiationTypes = Collections.unmodifiableMap(new HashMap<>(0));
typeMappings = Collections.unmodifiableMap(new HashMap<>(0));
additionalProperties = Collections.unmodifiableMap(new HashMap<>(0));
importMappings = Collections.unmodifiableMap(new HashMap<>(0));
languageSpecificPrimitives = Collections.unmodifiableSet(new HashSet<>(0));
reservedWordMappings = Collections.unmodifiableMap(new HashMap<>(0));
serverVariables = Collections.unmodifiableMap(new HashMap<>(0));
}

private void setDefaults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.openapitools.codegen.config;

import com.google.common.collect.ImmutableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -25,10 +24,7 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

Expand All @@ -51,7 +47,7 @@ public class WorkflowSettings {
public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true;
public static final boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false;
public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache";
public static final ImmutableMap<String, String> DEFAULT_GLOBAL_PROPERTIES = ImmutableMap.of();
public static final Map<String, String> DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>());

private String inputSpec;
private String outputDir = DEFAULT_OUTPUT_DIR;
Expand All @@ -68,7 +64,7 @@ public class WorkflowSettings {
private String templateDir;
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
private String ignoreFileOverride;
private ImmutableMap<String, ?> globalProperties = DEFAULT_GLOBAL_PROPERTIES;
private Map<String, ?> globalProperties = DEFAULT_GLOBAL_PROPERTIES;

private WorkflowSettings(Builder builder) {
this.inputSpec = builder.inputSpec;
Expand All @@ -84,7 +80,7 @@ private WorkflowSettings(Builder builder) {
this.templateDir = builder.templateDir;
this.templatingEngineName = builder.templatingEngineName;
this.ignoreFileOverride = builder.ignoreFileOverride;
this.globalProperties = ImmutableMap.copyOf(builder.globalProperties);
this.globalProperties = Collections.unmodifiableMap(builder.globalProperties);
this.generateAliasAsModel = builder.generateAliasAsModel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.openapitools.codegen.meta;

import com.google.common.collect.ImmutableList;
import org.openapitools.codegen.meta.features.*;
import org.openapitools.codegen.meta.features.annotations.AnnotationType;

Expand Down Expand Up @@ -203,7 +202,7 @@ public boolean isSupported() {
}

public List<AnnotationType> getSource() {
return ImmutableList.copyOf(source);
return Collections.unmodifiableList(source);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-gradle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-tooling-api</artifactId>
<version>${gradleVersion}</version>
<version>5.6.4</version>
</dependency>
</dependencies>
</plugin>
Expand Down
3 changes: 1 addition & 2 deletions modules/openapi-generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.exclusions>**/src/main/java/org/openapitools/codegen/plugin/**/*</sonar.exclusions>
<!-- used for integration tests verification scripts, managed by the test harness plugin -->
<groovy.version>3.0.5</groovy.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -59,7 +58,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<!-- <version>4.12</version> -->
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
34 changes: 9 additions & 25 deletions modules/openapi-generator-online/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,16 @@
<packaging>jar</packaging>
<name>openapi-generator-online</name>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<spring-boot-version>2.2.9.RELEASE</spring-boot-version>
<spring-boot.version>2.5.5</spring-boot.version>
<springfox-version>3.0.0</springfox-version>
<junit-version>4.13</junit-version>
<jackson-version>2.10.2</jackson-version>
<sonar.exclusions>**/org/openapitools/codegen/online/**/*</sonar.exclusions>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-version}</version>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -54,7 +49,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-version}</version>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -120,16 +115,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>jakarta.validation</groupId>
Expand All @@ -142,21 +127,20 @@
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>2.0.0.0</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class GenApiControllerTest {
@Autowired
private MockMvc mockMvc;


@Test
public void clientLanguages() throws Exception {
getLanguages("clients", "java");
Expand Down Expand Up @@ -126,4 +125,4 @@ public void generateWIthForwardedHeaders() throws Exception {
.andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0)));
}

}
}
Loading