From 067a092703f4e0d810ad7a217d4900015e3beb81 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 12:11:14 -0700 Subject: [PATCH 01/20] Bump spring versions to match other duracloud projects * SF -> 5.3.x * Data -> 2.7.x * Security -> 5.8.x * Batch -> 4.3.x --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index c3fb75b..d22b8be 100644 --- a/pom.xml +++ b/pom.xml @@ -186,10 +186,10 @@ UTF-8 1.7.6 - 4.3.30.RELEASE - 1.11.23.RELEASE - 4.2.20.RELEASE - 3.0.7.RELEASE + 5.3.29 + 2.7.15 + 5.8.5 + 4.3.10 5.4.3.Final 5.1.49 7.1.0 From 4a59dd53c1f58f443ca86b3370f0dd148dcc8adc Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 12:13:35 -0700 Subject: [PATCH 02/20] Update duracloud deps to latest release --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d22b8be..e2b79a8 100644 --- a/pom.xml +++ b/pom.xml @@ -192,8 +192,8 @@ 4.3.10 5.4.3.Final 5.1.49 - 7.1.0 - 7.1.0 + 8.0.0 + 8.0.0 1.1.0 1.3.4 2.12.3 From 0eb9029a19dd3ba28cca0f78af7067e199a928e9 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 12:18:27 -0700 Subject: [PATCH 03/20] Match commons-lang3 with duracloud version --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2b79a8..586120e 100644 --- a/pom.xml +++ b/pom.xml @@ -735,6 +735,10 @@ commons-io commons-io + + org.apache.commons + commons-lang3 + @@ -782,7 +786,7 @@ org.apache.commons commons-lang3 - 3.1 + 3.12.0 From bd9c8b356cf8e4bacb479fff586cd07f2c1c181d Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 14:21:05 -0700 Subject: [PATCH 04/20] Update easymock --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 586120e..06181b8 100644 --- a/pom.xml +++ b/pom.xml @@ -721,7 +721,7 @@ org.easymock easymock - 4.0.2 + 5.2.0 test From 7d42eda0081af2404740c8220f22a5df936244d5 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 14:22:18 -0700 Subject: [PATCH 05/20] Update spring data api usage --- .../bridge/rest/SnapshotResource.java | 4 ++-- .../service/impl/SnapshotManagerImpl.java | 19 +++++++++++-------- .../service/impl/SnapshotManagerImplTest.java | 5 +++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java b/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java index 36f3fa8..3924a9b 100644 --- a/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java +++ b/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/SnapshotResource.java @@ -620,7 +620,7 @@ public Response create(@PathParam("snapshotId") String snapshotId, log.info("cleaning up post exception..."); try { log.debug("deleting newly created snapshot..."); - snapshotRepo.delete(snapshot.getId()); + snapshotRepo.deleteById(snapshot.getId()); } catch (Exception e) { log.error("failed to cleanup snapshot " + snapshotId + ": " + e.getMessage(), e); @@ -778,7 +778,7 @@ public Response getContent(@PathParam("snapshotId") String snapshotId, pageSize = 1000; } - PageRequest pageable = new PageRequest(page, pageSize); + PageRequest pageable = PageRequest.of(page, pageSize); List items; if (null == prefix || prefix.equals("")) { diff --git a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SnapshotManagerImpl.java b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SnapshotManagerImpl.java index 12f991a..63d4d8d 100644 --- a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SnapshotManagerImpl.java +++ b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SnapshotManagerImpl.java @@ -186,16 +186,19 @@ public void addContentItem(Snapshot snapshot, @Transactional public Snapshot addAlternateSnapshotIds(Snapshot snapshot, List alternateIds) throws AlternateIdAlreadyExistsException { - snapshot = this.snapshotRepo.findOne(snapshot.getId()); - for (String altId : alternateIds) { - Snapshot altSnapshot = this.snapshotRepo.findBySnapshotAlternateIds(altId); - if (altSnapshot != null && !altSnapshot.getName().equals(snapshot.getName())) { - throw new AlternateIdAlreadyExistsException("The alternate snapshot id (" - + altId + ") already exists in another snapshot (" + - altSnapshot.getName() + ")"); + final var query = snapshotRepo.findById(snapshot.getId()); + if (query.isPresent()) { + snapshot = query.get(); + for (String altId : alternateIds) { + Snapshot altSnapshot = this.snapshotRepo.findBySnapshotAlternateIds(altId); + if (altSnapshot != null && !altSnapshot.getName().equals(snapshot.getName())) { + throw new AlternateIdAlreadyExistsException("The alternate snapshot id (" + + altId + ") already exists in another snapshot (" + + altSnapshot.getName() + ")"); + } } + snapshot.addSnapshotAlternateIds(alternateIds); } - snapshot.addSnapshotAlternateIds(alternateIds); return this.snapshotRepo.saveAndFlush(snapshot); } diff --git a/snapshot-service-impl/src/test/java/org/duracloud/snapshot/service/impl/SnapshotManagerImplTest.java b/snapshot-service-impl/src/test/java/org/duracloud/snapshot/service/impl/SnapshotManagerImplTest.java index dfc4ce2..76e5441 100644 --- a/snapshot-service-impl/src/test/java/org/duracloud/snapshot/service/impl/SnapshotManagerImplTest.java +++ b/snapshot-service-impl/src/test/java/org/duracloud/snapshot/service/impl/SnapshotManagerImplTest.java @@ -32,6 +32,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Optional; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -257,7 +258,7 @@ public void testAddDuplicateAlternateIdsInSameSnapshot() throws AlternateIdAlrea List alternateIds = Arrays.asList(new String[] {altTestId}); String snapshotId = "test"; expect(snapshot.getId()).andReturn(1l); - expect(this.snapshotRepo.findOne(isA(Long.class))).andReturn(snapshot); + expect(this.snapshotRepo.findById(isA(Long.class))).andReturn(Optional.of(snapshot)); expect(snapshot.getName()).andReturn(snapshotId).times(2); expect(this.snapshotRepo.findBySnapshotAlternateIds(altTestId)) @@ -279,7 +280,7 @@ public void testAddDuplicateAlternateIdsInDifferentSnapshot() { expect(snapshot2.getName()).andReturn("snapshot2").atLeastOnce(); expect(snapshot.getId()).andReturn(1l); - expect(this.snapshotRepo.findOne(isA(Long.class))).andReturn(snapshot); + expect(this.snapshotRepo.findById(isA(Long.class))).andReturn(Optional.of(snapshot)); expect(this.snapshotRepo.findBySnapshotAlternateIds(altTestId)).andReturn(snapshot2); replayAll(); From e046c98c9598d6ed65690fa48807e34f4e3f45a2 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 14:22:37 -0700 Subject: [PATCH 06/20] Remove exception which no longer exists --- .../snapshot/bridge/rest/RestoreResourceTest.java | 5 ++--- .../snapshot/bridge/rest/SnapshotResourceTest.java | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/RestoreResourceTest.java b/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/RestoreResourceTest.java index d48816c..15c2a04 100644 --- a/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/RestoreResourceTest.java +++ b/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/RestoreResourceTest.java @@ -15,7 +15,6 @@ import java.util.Date; import javax.ws.rs.core.Response; -import org.codehaus.jettison.json.JSONException; import org.duracloud.snapshot.SnapshotException; import org.duracloud.snapshot.common.test.SnapshotTestBase; import org.duracloud.snapshot.db.model.DuracloudEndPointConfig; @@ -162,7 +161,7 @@ public void testCancelSnapshot() throws SnapshotException { } @Test - public void testGetRestore() throws SnapshotException, JSONException { + public void testGetRestore() throws SnapshotException { String restorationId = "restoration-id"; Restoration restoration = setupRestoration(); expect(manager.get(restorationId)).andReturn(restoration); @@ -173,7 +172,7 @@ public void testGetRestore() throws SnapshotException, JSONException { } @Test - public void testGetRestoreBySnapshot() throws SnapshotException, JSONException { + public void testGetRestoreBySnapshot() throws SnapshotException { String snapshotId = "snapshot-id"; Restoration restoration = setupRestoration(); expect(manager.getBySnapshotId(snapshotId)).andReturn(restoration); diff --git a/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/SnapshotResourceTest.java b/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/SnapshotResourceTest.java index b5bb3c5..0822e21 100644 --- a/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/SnapshotResourceTest.java +++ b/snapshot-bridge-webapp/src/test/java/org/duracloud/snapshot/bridge/rest/SnapshotResourceTest.java @@ -25,7 +25,6 @@ import javax.ws.rs.core.Response.Status; import org.apache.http.HttpStatus; -import org.codehaus.jettison.json.JSONException; import org.duracloud.client.ContentStore; import org.duracloud.common.constant.Constants; import org.duracloud.common.notification.NotificationManager; @@ -304,7 +303,7 @@ public void testRestartFailure() throws SnapshotException { } @Test - public void testComplete() throws SnapshotException, JSONException { + public void testComplete() throws SnapshotException { String snapshotId = "snapshot-name"; List snapshotAlternateIds = new ArrayList(); String altId1 = "alternate-name-1"; @@ -335,7 +334,7 @@ public void testComplete() throws SnapshotException, JSONException { } @Test - public void testCompleteDuplicateAltId() throws SnapshotException, JSONException { + public void testCompleteDuplicateAltId() throws SnapshotException { String snapshotId = "snapshot-name"; List snapshotAlternateIds = new ArrayList(); String altId1 = "alternate-name-1"; @@ -359,7 +358,7 @@ public void testCompleteDuplicateAltId() throws SnapshotException, JSONException } @Test - public void testCancel() throws SnapshotException, JSONException { + public void testCancel() throws SnapshotException { String snapshotId = "snapshot-name"; expect(this.snapshotRepo.findByName(snapshotId)).andReturn(snapshot); @@ -375,7 +374,7 @@ public void testCancel() throws SnapshotException, JSONException { } @Test - public void testCancelFailure() throws SnapshotException, JSONException { + public void testCancelFailure() throws SnapshotException { String snapshotId = "snapshot-name"; expect(this.snapshotRepo.findByName(snapshotId)).andReturn(snapshot); @@ -386,7 +385,6 @@ public void testCancelFailure() throws SnapshotException, JSONException { assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus()); assertTrue(response.getEntity() instanceof ResponseDetails); assertNotNull(((ResponseDetails) response.getEntity()).getMessage()); - } @Test From 329f634d6e9a005e9d3b2d119c4abece87c32759 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 14:50:31 -0700 Subject: [PATCH 07/20] Replace wix with testcontainers --- pom.xml | 16 ++---- snapshot-common-db/pom.xml | 4 +- .../snapshot/db/JpaIntegrationTestBase.java | 50 ++++++++----------- .../snapshot/db/repo/SnapshotRepoTest.java | 1 + .../src/test/resources/db_init.sql | 3 +- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/pom.xml b/pom.xml index 06181b8..6485bc3 100644 --- a/pom.xml +++ b/pom.xml @@ -726,20 +726,10 @@ - com.wix - wix-embedded-mysql - 2.2.10 + org.testcontainers + mysql + 1.19.3 test - - - commons-io - commons-io - - - org.apache.commons - commons-lang3 - - diff --git a/snapshot-common-db/pom.xml b/snapshot-common-db/pom.xml index ff4f809..078eb7e 100644 --- a/snapshot-common-db/pom.xml +++ b/snapshot-common-db/pom.xml @@ -74,8 +74,8 @@ - com.wix - wix-embedded-mysql + org.testcontainers + mysql diff --git a/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/JpaIntegrationTestBase.java b/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/JpaIntegrationTestBase.java index c5ef012..c48eaa4 100644 --- a/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/JpaIntegrationTestBase.java +++ b/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/JpaIntegrationTestBase.java @@ -8,22 +8,14 @@ package org.duracloud.snapshot.db; -import static com.wix.mysql.EmbeddedMysql.anEmbeddedMysql; -import static com.wix.mysql.config.Charset.UTF8; -import static com.wix.mysql.config.MysqldConfig.aMysqldConfig; -import static com.wix.mysql.distribution.Version.v5_7_latest; - -import java.util.concurrent.TimeUnit; - -import com.wix.mysql.EmbeddedMysql; -import com.wix.mysql.ScriptResolver; -import com.wix.mysql.config.MysqldConfig; import org.easymock.EasyMockRunner; import org.easymock.EasyMockSupport; -import org.junit.After; -import org.junit.Before; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; import org.junit.runner.RunWith; import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.testcontainers.containers.MySQLContainer; /** * @author Daniel Bernstein @@ -32,31 +24,29 @@ @RunWith(EasyMockRunner.class) public abstract class JpaIntegrationTestBase extends EasyMockSupport { - private EmbeddedMysql mysqld = null; - - protected AnnotationConfigApplicationContext context; + @ClassRule + public static MySQLContainer mysql = new MySQLContainer<>() + .withUsername("user") + .withPassword("pass") + .withDatabaseName("snapshot") + .withInitScript("db_init.sql") + .withEnv("TZ", "GMT") + .withEnv("max_connect_errors", "666"); - @Before - public void setup() { - int port = 3310; - MysqldConfig config = aMysqldConfig(v5_7_latest).withCharset(UTF8).withPort(port).withUser("user", "pass") - .withTimeZone("GMT").withTimeout(2, TimeUnit.MINUTES) - .withServerVariable("max_connect_errors", 666) - .withServerVariable("log_syslog", 0) - .build(); - - mysqld = anEmbeddedMysql(config).addSchema("snapshot", ScriptResolver.classPathScript("db_init.sql")).start(); + protected static AnnotationConfigApplicationContext context; + @BeforeClass + public static void setup() { System.setProperty("generate.database", "true"); - System.setProperty("snapshot.db.port", port + ""); + System.setProperty("snapshot.db.port", mysql.getFirstMappedPort().toString()); context = new AnnotationConfigApplicationContext("org.duracloud.snapshot.db"); - } - @After - public void tearDown() { - mysqld.stop(); + @AfterClass + public static void tearDown() { + context.close(); + mysql.close(); } } diff --git a/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/repo/SnapshotRepoTest.java b/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/repo/SnapshotRepoTest.java index cd8053c..6ea05b8 100644 --- a/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/repo/SnapshotRepoTest.java +++ b/snapshot-common-db/src/test/java/org/duracloud/snapshot/db/repo/SnapshotRepoTest.java @@ -23,6 +23,7 @@ * @author Daniel Bernstein */ public class SnapshotRepoTest extends JpaIntegrationTestBase { + @Test public void testFindByStatusOrderBySnapshotDateAsc() { SnapshotRepo repo = context.getBean(SnapshotRepo.class); diff --git a/snapshot-common-db/src/test/resources/db_init.sql b/snapshot-common-db/src/test/resources/db_init.sql index 47b8bba..d0dd02b 100644 --- a/snapshot-common-db/src/test/resources/db_init.sql +++ b/snapshot-common-db/src/test/resources/db_init.sql @@ -1,2 +1 @@ -grant all privileges on mill.* to "user"@"localhost" identified by "pass"; -flush privileges; \ No newline at end of file +ALTER DATABASE snapshot CHARACTER SET utf8 COLLATE utf8_general_ci; From 8e3727fcef2a2a45419518f694da20250f3f5fcd Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 15:01:25 -0700 Subject: [PATCH 08/20] Update slf4j and logback --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6485bc3..94bb9ab 100644 --- a/pom.xml +++ b/pom.xml @@ -185,7 +185,8 @@ INFO UTF-8 - 1.7.6 + 2.0.9 + 1.4.14 5.3.29 2.7.15 5.8.5 @@ -657,7 +658,7 @@ ch.qos.logback logback-classic - 1.2.0 + ${logback.version} From c0aad8051e1b05070a271b87b384b827f0b56095 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 15:03:34 -0700 Subject: [PATCH 09/20] Update jackson --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94bb9ab..7513cb8 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ 8.0.0 1.1.0 1.3.4 - 2.12.3 + 2.16.0 2.3.1 2.3.3 1.3.2 From 7a1633a9d0e78f08bc0d5b3a41ea713c050a633a Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 11 Dec 2023 15:19:05 -0700 Subject: [PATCH 10/20] Update hibernate and mysql-connector --- pom.xml | 22 +++++++++++-------- snapshot-bridge-webapp/pom.xml | 4 ++-- snapshot-common-db/pom.xml | 4 ++-- .../snapshot/db/SnapshotDatabaseConfig.java | 2 +- snapshot-service-impl/pom.xml | 4 ++-- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 7513cb8..dffc3e5 100644 --- a/pom.xml +++ b/pom.xml @@ -191,8 +191,9 @@ 2.7.15 5.8.5 4.3.10 - 5.4.3.Final - 5.1.49 + 5.4.33.Final + 5.4.3.Final + 8.2.0 8.0.0 8.0.0 1.1.0 @@ -674,11 +675,18 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.connector.version} + + + org.jboss.logging + jboss-logging + 3.4.1.Final + + org.hibernate hibernate-entitymanager @@ -688,12 +696,8 @@ org.hibernate hibernate-validator - ${hibernate.version} + ${hibernate.validator.version} - - org.jboss.logging - jboss-logging - com.fasterxml classmate diff --git a/snapshot-bridge-webapp/pom.xml b/snapshot-bridge-webapp/pom.xml index 1f5b2dd..946a9e7 100644 --- a/snapshot-bridge-webapp/pom.xml +++ b/snapshot-bridge-webapp/pom.xml @@ -220,8 +220,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/snapshot-common-db/pom.xml b/snapshot-common-db/pom.xml index 078eb7e..f306ddf 100644 --- a/snapshot-common-db/pom.xml +++ b/snapshot-common-db/pom.xml @@ -40,8 +40,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/snapshot-common-db/src/main/java/org/duracloud/snapshot/db/SnapshotDatabaseConfig.java b/snapshot-common-db/src/main/java/org/duracloud/snapshot/db/SnapshotDatabaseConfig.java index 412cea6..a62d2f8 100644 --- a/snapshot-common-db/src/main/java/org/duracloud/snapshot/db/SnapshotDatabaseConfig.java +++ b/snapshot-common-db/src/main/java/org/duracloud/snapshot/db/SnapshotDatabaseConfig.java @@ -47,7 +47,7 @@ public class SnapshotDatabaseConfig { @Bean(name = SNAPSHOT_REPO_DATA_SOURCE_BEAN, destroyMethod = "close") public BasicDataSource snapshotDataSource() { BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName("com.mysql.jdbc.Driver"); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); dataSource.setUrl(MessageFormat.format("jdbc:mysql://{0}:{1}/{2}" + "?useLegacyDatetimeCode=false" + "&serverTimezone=GMT" + diff --git a/snapshot-service-impl/pom.xml b/snapshot-service-impl/pom.xml index 28c3472..1090358 100644 --- a/snapshot-service-impl/pom.xml +++ b/snapshot-service-impl/pom.xml @@ -184,8 +184,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j From dcda66419eec17d4cc3e8284c59f9e6a42079b90 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 13:21:22 -0700 Subject: [PATCH 11/20] Misc dependency updates * javax.interceptor-api * aspectjweaver * dbcp2 * mapdb --- pom.xml | 7 ++++--- snapshot-service-impl/pom.xml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index dffc3e5..dc06ebc 100644 --- a/pom.xml +++ b/pom.xml @@ -568,7 +568,7 @@ javax.interceptor javax.interceptor-api - 1.2 + 1.2.2 @@ -604,7 +604,7 @@ org.aspectj aspectjweaver - 1.8.8 + 1.9.21 @@ -623,7 +623,7 @@ org.apache.commons commons-dbcp2 - 2.1 + 2.11.0 commons-logging @@ -639,6 +639,7 @@ + javax.xml.bind jaxb-api ${jaxb.api.version} diff --git a/snapshot-service-impl/pom.xml b/snapshot-service-impl/pom.xml index 1090358..c8984ff 100644 --- a/snapshot-service-impl/pom.xml +++ b/snapshot-service-impl/pom.xml @@ -201,7 +201,7 @@ org.mapdb mapdb - 3.0.5 + 3.0.10 From c704beed67fa16a805bc05ccc1fa2ea554e2ad72 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 14:59:31 -0700 Subject: [PATCH 12/20] Plugin updates --- pom.xml | 20 ++++++++++---------- rewrite/pom.xml | 2 +- snapshot-bridge-webapp/pom.xml | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index dc06ebc..19c0d5f 100644 --- a/pom.xml +++ b/pom.xml @@ -120,7 +120,7 @@ org.apache.maven.plugins maven-source-plugin - 2.3 + 3.3.0 attach-sources @@ -135,7 +135,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.6.3 attach-javadocs @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts @@ -263,7 +263,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.6 + 1.6.13 true sonatype-releases @@ -278,7 +278,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.11.0 11 UTF-8 @@ -306,7 +306,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.16 + 3.2.3 @@ -363,7 +363,7 @@ maven-resources-plugin - 3.0.1 + 3.3.1 copy-resources @@ -387,7 +387,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M3 + 3.4.1 @@ -405,7 +405,7 @@ - [3.5.0,4.0.0) + [3.6.3,4.0.0) @@ -417,7 +417,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.0 + 3.3.1 verify-style diff --git a/rewrite/pom.xml b/rewrite/pom.xml index ba7b87d..dc66ebc 100644 --- a/rewrite/pom.xml +++ b/rewrite/pom.xml @@ -22,7 +22,7 @@ org.apache.maven.plugins maven-dependency-plugin - 2.10 + 3.6.1 copy-build-artifact diff --git a/snapshot-bridge-webapp/pom.xml b/snapshot-bridge-webapp/pom.xml index 946a9e7..d83926d 100644 --- a/snapshot-bridge-webapp/pom.xml +++ b/snapshot-bridge-webapp/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-war-plugin - 2.4 + 3.4.0 ${project.artifactId}-${project.version} @@ -64,7 +64,7 @@ org.apache.maven.plugins maven-dependency-plugin - 2.10 + 3.6.1 copy-build-artifact From 69049f8d940079d7f24faa5137695226c2e1cad3 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 15:00:09 -0700 Subject: [PATCH 13/20] Add maven-war-plugin --- rewrite/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rewrite/pom.xml b/rewrite/pom.xml index dc66ebc..3b73c20 100644 --- a/rewrite/pom.xml +++ b/rewrite/pom.xml @@ -47,6 +47,11 @@ + + org.apache.maven.plugins + maven-war-plugin + 3.4.0 + From e691cd9dfa78356909452b75f248e348609a9d12 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 15:02:30 -0700 Subject: [PATCH 14/20] Remove redundant groupId --- rewrite/pom.xml | 1 - snapshot-bridge-webapp/pom.xml | 1 - snapshot-common-db/pom.xml | 1 - snapshot-common-test/pom.xml | 1 - snapshot-common/pom.xml | 1 - snapshot-service-impl/pom.xml | 1 - snapshot-service/pom.xml | 1 - 7 files changed, 7 deletions(-) diff --git a/rewrite/pom.xml b/rewrite/pom.xml index 3b73c20..02b6497 100644 --- a/rewrite/pom.xml +++ b/rewrite/pom.xml @@ -2,7 +2,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - org.duracloud.snapshot ROOT war 3.2.0-SNAPSHOT diff --git a/snapshot-bridge-webapp/pom.xml b/snapshot-bridge-webapp/pom.xml index d83926d..9082882 100644 --- a/snapshot-bridge-webapp/pom.xml +++ b/snapshot-bridge-webapp/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 3.2.0-SNAPSHOT - org.duracloud.snapshot bridge war DuraCloud to Bridge Web Application diff --git a/snapshot-common-db/pom.xml b/snapshot-common-db/pom.xml index f306ddf..f3b87fa 100644 --- a/snapshot-common-db/pom.xml +++ b/snapshot-common-db/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 3.2.0-SNAPSHOT - org.duracloud.snapshot snapshot-common-db jar Snapshot Common DB diff --git a/snapshot-common-test/pom.xml b/snapshot-common-test/pom.xml index 46bf7f9..536b7bc 100644 --- a/snapshot-common-test/pom.xml +++ b/snapshot-common-test/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - org.duracloud.snapshot snapshot-common-test jar 3.2.0-SNAPSHOT diff --git a/snapshot-common/pom.xml b/snapshot-common/pom.xml index 3647b33..6ee99c6 100644 --- a/snapshot-common/pom.xml +++ b/snapshot-common/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 3.2.0-SNAPSHOT - org.duracloud.snapshot snapshot-common jar Snapshot Common diff --git a/snapshot-service-impl/pom.xml b/snapshot-service-impl/pom.xml index c8984ff..4cf976a 100644 --- a/snapshot-service-impl/pom.xml +++ b/snapshot-service-impl/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - org.duracloud.snapshot snapshot-service-impl jar 3.2.0-SNAPSHOT diff --git a/snapshot-service/pom.xml b/snapshot-service/pom.xml index 62322e8..797555b 100644 --- a/snapshot-service/pom.xml +++ b/snapshot-service/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 3.2.0-SNAPSHOT - org.duracloud.snapshot snapshot-service jar Snapshot Service Layer From 614ec5ec394b0b095cd23c1f48e8ac7e2921f9d2 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 15:03:22 -0700 Subject: [PATCH 15/20] Update CI to java 17 --- .github/workflows/ci-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index e9455dc..3df430d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -20,10 +20,10 @@ jobs: uses: actions/checkout@v2 # https://github.com/actions/setup-java - - name: Install JDK 11 + - name: Install JDK 17 uses: actions/setup-java@v2 with: - java-version: 11 + java-version: 17 distribution: adopt # https://github.com/actions/cache @@ -47,7 +47,7 @@ jobs: uses: actions/setup-java@v2 if: github.ref == 'refs/heads/develop' && github.event_name == 'push' with: - java-version: 11 + java-version: 17 distribution: adopt server-id: sonatype-snapshots # Value of the distributionManagement/repository/id field of the pom.xml server-username: SONATYPE_USERNAME # env variable for sonatype username @@ -59,7 +59,7 @@ jobs: uses: actions/setup-java@v2 if: github.ref == 'refs/heads/main' && github.event_name == 'push' with: - java-version: 11 + java-version: 17 distribution: adopt server-id: sonatype-releases # Value of the distributionManagement/repository/id field of the pom.xml server-username: SONATYPE_USERNAME # env variable for sonatype username From 6436a81303646119ac60c41372af8a2f253d5457 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 13 Dec 2023 15:09:31 -0700 Subject: [PATCH 16/20] Another maven plugin update --- snapshot-service-impl/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshot-service-impl/pom.xml b/snapshot-service-impl/pom.xml index 4cf976a..93a6d69 100644 --- a/snapshot-service-impl/pom.xml +++ b/snapshot-service-impl/pom.xml @@ -22,7 +22,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.2 + 3.5.1 false From 3279b3e94a18904b402932b2ff0b9406989a043b Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 10 Jan 2024 14:08:14 -0700 Subject: [PATCH 17/20] Increase memory usage for maven --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 3df430d..3d86765 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest env: # Specify memory for Maven - MAVEN_OPTS: "-Xmx256M" + MAVEN_OPTS: "-Xmx512M" steps: # Output current build environment - run: echo "This is a CI build of branch ${{ github.ref }} in repository ${{ github.repository }}" From 047e0830a63b3f6e6c865e6ac9ebdbfaae6b5d22 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Wed, 10 Jan 2024 14:29:59 -0700 Subject: [PATCH 18/20] Set release version to 17 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19c0d5f..5c69dfe 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ maven-compiler-plugin 3.11.0 - 11 + 17 UTF-8 From f987a6048c37b7a047ac815894780529e1c743c2 Mon Sep 17 00:00:00 2001 From: Daniel Bernstein Date: Fri, 1 Mar 2024 09:43:53 -0800 Subject: [PATCH 19/20] Fix password encoding issue. --- .../snapshot/bridge/rest/config/WebSecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/config/WebSecurityConfig.java b/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/config/WebSecurityConfig.java index 33e553e..87f022a 100644 --- a/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/config/WebSecurityConfig.java +++ b/snapshot-bridge-webapp/src/main/java/org/duracloud/snapshot/bridge/rest/config/WebSecurityConfig.java @@ -31,7 +31,7 @@ public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception RootUserCredential root = new RootUserCredential(); auth.inMemoryAuthentication() .withUser(root.getUsername()) - .password(root.getPassword()) + .password("{noop}" + root.getPassword()) //noop required for spring 5 .roles("USER"); } } \ No newline at end of file From 326509e170e77260c8875a5b117c8258fa5ac0f8 Mon Sep 17 00:00:00 2001 From: Daniel Bernstein Date: Fri, 1 Mar 2024 13:27:00 -0800 Subject: [PATCH 20/20] Update sql script for compatibility wiht mysql 8. --- .../org/duracloud/snapshot/sql/snapshot-create-mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshot-common-db/src/main/resources/org/duracloud/snapshot/sql/snapshot-create-mysql.sql b/snapshot-common-db/src/main/resources/org/duracloud/snapshot/sql/snapshot-create-mysql.sql index d605581..c5b9db8 100644 --- a/snapshot-common-db/src/main/resources/org/duracloud/snapshot/sql/snapshot-create-mysql.sql +++ b/snapshot-common-db/src/main/resources/org/duracloud/snapshot/sql/snapshot-create-mysql.sql @@ -3,7 +3,7 @@ -- Host: localhost Database: snapshot -- ------------------------------------------------------ -- Server version 5.5.38 - +/*!40101 SET @saved_cs_client = 'utf8' */; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;