Skip to content

Commit

Permalink
DR2-2038 Upate Derby database
Browse files Browse the repository at this point in the history
This is now the latest version of derby.

This version needs Java 21. I've updated the bundled version to use 21.

The name of the driver class has changed and has been updated in all of
the places it's set.

I wanted to get this working on 21 anyway. DROID itself runs happily on
21 but the tests weren't passing because of how old Mockito was so I've
upgraded that.

I've removed versions 7 and 11 and 17 from the CI workflow.

I've updated the ci workflow to use an NVD API key which is set in the
repository secrets to stop the ci run taking an hour periodically.

I've removed the supressions for the old version of the derby DB

The last thing was an odd test failure in the tests for ProfileFileChooser
It was saying that multiSelectionEnabled was true when run on Java 21.
If you run DROID on Java 21 then multi selection is enabled. I'm not
sure why but setting it to false in the setup method brings back the old
behaviour.
  • Loading branch information
MancunianSam committed Jan 14, 2025
1 parent 4232279 commit c922787
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 70 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
jdk: [8, 11, 17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
java-version: 21
distribution: temurin
- name: Cache Maven packages
uses: actions/cache@v2
Expand All @@ -29,6 +28,6 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Maven Build
run: mvn -V -B -DskipTests=true install
run: mvn -V -B -DskipTests=true install -DnvdApiKey=${{ secrets.NVD_API_KEY }}
- name: Maven Test
run: mvn -B verify
run: mvn -B verify -DnvdApiKey=${{ secrets.NVD_API_KEY }}
8 changes: 0 additions & 8 deletions droid-binary/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

6 changes: 3 additions & 3 deletions droid-binary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</goals>
<configuration>
<!-- To update, retrieve link for 64 bit Windows jre from https://adoptium.net -->
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip</url>
<url>https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jre_x64_windows_hotspot_21.0.5_11.zip</url>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
Expand All @@ -55,9 +55,9 @@
<configuration>
<target>
<!-- Update binary from https://adoptopenjdk.net/releases.html -->
<unzip dest="${project.build.directory}/jre_tmp/" src="${project.build.directory}/OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip" />
<unzip dest="${project.build.directory}/jre_tmp/" src="${project.build.directory}/OpenJDK21U-jre_x64_windows_hotspot_21.0.5_11.zip" />
<move todir="${project.build.directory}/jre-windows/">
<fileset dir="${project.build.directory}/jre_tmp/jdk-17.0.11+9-jre/">
<fileset dir="${project.build.directory}/jre_tmp/jdk-21.0.5+11-jre/">
<include name="**/*" />
</fileset>
</move>
Expand Down
8 changes: 0 additions & 8 deletions droid-command-line/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
package uk.gov.nationalarchives.droid.command;

import junit.framework.Assert;
import net.bytebuddy.asm.Advice;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
Expand Down
8 changes: 0 additions & 8 deletions droid-export/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

2 changes: 1 addition & 1 deletion droid-export/src/test/resources/jpa-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

datasource.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
datasource.driverClassName=org.apache.derby.iapi.jdbc.AutoloadedDriver
datasource.url=jdbc:derby:droid-test-db;create=true
datasource.username=droid_user
datasource.password=droid_user
Expand Down
4 changes: 2 additions & 2 deletions droid-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

<spring.version>5.3.27</spring.version>
<hibernate.version>5.4.1.Final</hibernate.version>
<derby.version>10.13.1.1</derby.version>
<derby.version>10.17.1.0</derby.version>
<cxf.version>3.5.9</cxf.version>
<java.iso-tools.version>2.1.0</java.iso-tools.version>
<jaxb.version>2.3.1</jaxb.version>
Expand Down Expand Up @@ -764,7 +764,7 @@ Copyright &copy; ${project.inceptionYear}-{currentYear} <a href="${project.organ
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.6.1</version>
<version>5.15.2</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
Expand Down
7 changes: 0 additions & 7 deletions droid-report-interfaces/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>
8 changes: 0 additions & 8 deletions droid-report/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

2 changes: 1 addition & 1 deletion droid-report/src/test/resources/jpa-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

datasource.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
datasource.driverClassName=org.apache.derby.iapi.jdbc.AutoloadedDriver
datasource.url=jdbc:derby:droid-test-db;create=true
datasource.username=droid_user
datasource.password=droid_user
Expand Down
8 changes: 0 additions & 8 deletions droid-results/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

2 changes: 1 addition & 1 deletion droid-results/src/main/resources/jpa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

datasource.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
datasource.driverClassName=org.apache.derby.iapi.jdbc.AutoloadedDriver
datasource.username=droid_user
datasource.password=droid_user
datasource.maxActive=100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
*/
public class ProfileManagerImplTest {

private static final String DERBY_DRIVER_CLASSNAME = "org.apache.derby.jdbc.EmbeddedDriver";
private static final String DERBY_DRIVER_CLASSNAME = "org.apache.derby.iapi.jdbc.AutoloadedDriver";

private ProfileManagerImpl profileManager;
private ProfileSpecDao profileSpecDao;
Expand Down
2 changes: 1 addition & 1 deletion droid-results/src/test/resources/jpa-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

datasource.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
datasource.driverClassName=org.apache.derby.iapi.jdbc.AutoloadedDriver
datasource.url=jdbc:derby:target/droid-test-db;create=true
datasource.username=droid_user
datasource.password=droid_user
Expand Down
8 changes: 0 additions & 8 deletions droid-swing-ui/dependency-check/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: derby-10.13.1.1.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.apache\.derby/derby@.*$</packageUrl>
<cve>CVE-2022-46337</cve>
</suppress>
</suppressions>

Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected void setup(FileSystemView view) {
FileNameExtensionFilter filter = new FileNameExtensionFilter("DROID 6 profile", "droid");
addChoosableFileFilter(filter);
setFileFilter(filter);
setMultiSelectionEnabled(false);
}

/**
Expand Down

0 comments on commit c922787

Please sign in to comment.