Skip to content

Commit 31745c6

Browse files
committed
Revise project dependencies.
Also introduce flag how the dependency is used/references whether to check for dependency/dependencyManagement instead of maintaining a list of exclusions. Closes #107
1 parent 152a119 commit 31745c6

File tree

3 files changed

+117
-90
lines changed

3 files changed

+117
-90
lines changed

src/main/java/org/springframework/data/release/infra/Dependencies.java

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ public class Dependencies {
2828

2929
static final List<Dependency> dependencies = new ArrayList<>();
3030

31+
public static final Dependency ANTLR = Dependency.of("ANTLR", "org.antlr:antlr4-runtime");
32+
3133
public static final Dependency APT = Dependency.of("APT", "com.mysema.maven:apt-maven-plugin");
3234

3335
public static final Dependency ASPECTJ = Dependency.of("AspectJ", "org.aspectj:aspectjrt");
3436

3537
public static final Dependency ASSERTJ = Dependency.of("AssertJ", "org.assertj:assertj-core");
3638

39+
public static final Dependency AWAITILITY = Dependency.of("Awaitility", "org.awaitility:awaitility");
40+
3741
public static final Dependency JACKSON = Dependency.of("Jackson", "com.fasterxml.jackson:jackson-bom");
3842

3943
public static final Dependency JACOCO = Dependency.of("Jacoco", "org.jacoco:jacoco");
@@ -94,32 +98,22 @@ public class Dependencies {
9498

9599
public static final Dependency MONGODB_CORE = Dependency.of("MongoDB", "org.mongodb:mongodb-driver-core");
96100

97-
public static final Dependency MONGODB_LEGACY = Dependency.of("MongoDB", "org.mongodb:mongo-java-driver");
98-
99-
public static final Dependency MONGODB_SYNC = Dependency.of("MongoDB", "org.mongodb:mongodb-driver-sync");
100-
101-
public static final Dependency MONGODB_ASYNC = Dependency.of("MongoDB", "org.mongodb:mongodb-driver-async");
102-
103-
public static final Dependency MONGODB_RS = Dependency.of("MongoDB Reactive Streams",
104-
"org.mongodb:mongodb-driver-reactivestreams");
101+
public static final Dependency MONGODB_BOM = Dependency.of("MongoDB", "org.mongodb:mongodb-driver-bom");
105102

106103
public static final Dependency LETTUCE = Dependency.of("Lettuce", "io.lettuce:lettuce-core");
107104

108105
public static final Dependency JEDIS = Dependency.of("Jedis", "redis.clients:jedis");
109106

107+
public static final Dependency JSQLPARSER = Dependency.of("JSqlParser", "com.github.jsqlparser:jsqlparser");
108+
110109
public static final Dependency JMOLECULES = Dependency.of("JMolecules", "org.jmolecules:jmolecules");
111110

112111
public static final Dependency JMOLECULES_INTEGRATION = Dependency.of("JMolecules",
113112
"org.jmolecules.integrations:jmolecules-spring");
114113

115-
public static final Dependency CASSANDRA_DRIVER3 = Dependency.of("Cassandra Driver",
116-
"com.datastax.cassandra:cassandra-driver-core");
117-
118114
public static final Dependency CASSANDRA_DRIVER4 = Dependency.of("Cassandra Driver",
119115
"org.apache.cassandra:java-driver-bom");
120116

121-
public static final Dependency NEO4J_OGM = Dependency.of("Neo4j OGM", "org.neo4j:neo4j-ogm-api");
122-
123117
public static final Dependency NEO4J_DRIVER = Dependency.of("Neo4j Driver", "org.neo4j.driver:neo4j-java-driver");
124118

125119
public static final Dependency COUCHBASE = Dependency.of("Couchbase Client", "com.couchbase.client:java-client");
@@ -136,18 +130,33 @@ public class Dependencies {
136130
public static final Dependency MAVEN = Dependency.of("Maven Wrapper", "org.apache.maven:apache-maven");
137131

138132
public static final Dependency H2 = Dependency.of("H2 Database", "com.h2database:h2");
133+
139134
public static final Dependency H2_R2DBC = Dependency.of("H2 R2DBC Driver", "io.r2dbc:r2dbc-h2");
135+
140136
public static final Dependency HSQLDB = Dependency.of("HSQL Database", "org.hsqldb:hsqldb");
137+
141138
public static final Dependency DB2_JDBC = Dependency.of("DB2 JDBC Driver", "com.ibm.db2:jcc");
139+
142140
public static final Dependency MARIADB_JDBC = Dependency.of("MariaDB JDBC Driver", "org.mariadb.jdbc:mariadb-java-client");
141+
143142
public static final Dependency MARIADB_R2DBC = Dependency.of("MariaDB R2DBC Driver", "rg.mariadb:r2dbc-mariadb");
143+
144144
public static final Dependency MS_SQLSERVER_JDBC = Dependency.of("Microsoft SqlServer JDBC Driver", "com.microsoft.sqlserver:mssql-jdbc");
145+
145146
public static final Dependency MS_SQLSERVER_R2DBC = Dependency.of("Microsoft SqlServer R2DBC Driver", "io.r2dbc:r2dbc-mssql");
146-
public static final Dependency MYSQL_JDBC = Dependency.of("MySql JDBC Driver", "mysql:mysql-connector-java");
147+
148+
public static final Dependency LEGACY_MYSQL_JDBC = Dependency.of("MySql JDBC Driver", "mysql:mysql-connector-java");
149+
150+
public static final Dependency MYSQL_JDBC = Dependency.of("MySql JDBC Driver", "com.mysql:mysql-connector-j");
151+
147152
public static final Dependency MYSQL_R2DBC = Dependency.of("MySql R2DBC Driver", "io.asyncer:r2dbc-mysql");
153+
148154
public static final Dependency POSTGRES_JDBC = Dependency.of("Postgres JDBC Driver", "org.postgresql:postgresql");
155+
149156
public static final Dependency POSTGRES_R2DBC = Dependency.of("Postgres R2DBC Driver", "org.postgresql:r2dbc-postgresql");
157+
150158
public static final Dependency ORACLE_JDBC = Dependency.of("Oracle JDBC Driver", "com.oracle.database.jdbc:ojdbc11");
159+
151160
public static final Dependency ORACLE_R2DBC = Dependency.of("Oracle R2DBC Driver", "com.oracle.database.r2dbc:oracle-r2dbc");
152161

153162
static {

src/main/java/org/springframework/data/release/infra/DependencyOperations.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.time.LocalDateTime;
3030
import java.time.format.DateTimeFormatter;
3131
import java.util.ArrayList;
32-
import java.util.Arrays;
3332
import java.util.Collections;
3433
import java.util.HashSet;
3534
import java.util.LinkedHashMap;
@@ -69,6 +68,7 @@
6968
import org.springframework.util.StringUtils;
7069
import org.springframework.web.client.HttpClientErrorException;
7170
import org.springframework.web.client.RestOperations;
71+
7272
import org.xmlbeam.ProjectionFactory;
7373
import org.xmlbeam.annotation.XBRead;
7474
import org.xmlbeam.io.FileIO;
@@ -376,7 +376,7 @@ private Optional<Ticket> getDependencyUpgradeTicket(Tickets tickets, String upgr
376376
return Optional.ofNullable(upgradeTickets.isEmpty() ? null : upgradeTickets.get(0));
377377
}
378378

379-
protected static DependencyUpgradeProposal getDependencyUpgradeProposal(DependencyUpgradePolicy policy,
379+
static DependencyUpgradeProposal getDependencyUpgradeProposal(DependencyUpgradePolicy policy,
380380
DependencyVersion currentVersion, List<DependencyVersion> allVersions) {
381381

382382
Optional<DependencyVersion> latestMinor = findLatestMinor(policy, currentVersion, allVersions);
@@ -472,7 +472,7 @@ DependencyVersions getCurrentDependencies(SupportedProject supportedProject) {
472472
ProjectDependencies dependencies = ProjectDependencies.get(supportedProject);
473473

474474
Set<Project> skipDependencyDeclarationCheck = new HashSet<>(
475-
Arrays.asList(Projects.NEO4J, Projects.BUILD, Projects.JPA, Projects.RELATIONAL));
475+
Collections.singletonList(Projects.BUILD));
476476

477477
return doWithPom(pom, Pom.class, it -> {
478478

@@ -482,8 +482,7 @@ DependencyVersions getCurrentDependencies(SupportedProject supportedProject) {
482482

483483
Dependency dependency = projectDependency.getDependency();
484484

485-
if (!(project == Projects.MONGO_DB && projectDependency.getProperty().equals("mongo.reactivestreams")
486-
|| skipDependencyDeclarationCheck.contains(project))) {
485+
if (!skipDependencyDeclarationCheck.contains(project) && projectDependency.isVerifyUsage()) {
487486

488487
if (it.getDependencyVersion(dependency.getArtifactId()) == null
489488
&& it.getManagedDependency(dependency.getArtifactId()) == null) {

0 commit comments

Comments
 (0)