Skip to content

Commit 4860ccc

Browse files
committed
Upgrade to netCDF-Java 5.9.0-SNAPSHOT
Also, now that TDS 5.7-SNAPSHOT bundles in code from tds-plugin, we needed to make some some changes to the testcontainer environment to ensure it uses the nciso-common and tds-plugin classes from this repo and not those bundled with the TDS. Additionally, the integration test requiring the testcontainer infrastructure is now run as part of the verify lifecycle and excluded from the test lifecycle.
1 parent d654f4f commit 4860ccc

File tree

4 files changed

+46
-43
lines changed

4 files changed

+46
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The NOAA/NGDC ncISO team and the Unidata THREDDS team work closely (and with the
2929

3030
| netCDF-Java / TDS Version | threddsISO | threddsISO Tag |
3131
|:--------------------------|:---------------|:---------------|
32-
| 5.8.0 / 5.7-SNAPSHOT | 2.4.8-SNAPSHOT | |
32+
| 5.9.0 / 5.7-SNAPSHOT | 2.4.8-SNAPSHOT | |
3333
| 5.7.0 / 5.6 | 2.4.7 | **v2.4.7** |
3434
| 5.6.0 / 5.5 | 2.4.6 | **v2.4.6** |
3535
| 5.5.3 / 5.4 | 2.4.5 | **v2.4.5** |

tds-plugin/pom.xml

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -92,56 +92,37 @@
9292
<artifactId>maven-surefire-plugin</artifactId>
9393
<configuration>
9494
<skip>${skipTests}</skip>
95+
<excludedGroups>thredds.server.metadata.Integration</excludedGroups>
9596
</configuration>
9697
</plugin>
9798
<plugin>
98-
<groupId>org.apache.maven.plugins</groupId>
99-
<artifactId>maven-jar-plugin</artifactId>
99+
<artifactId>maven-failsafe-plugin</artifactId>
100+
<version>3.1.2</version>
100101
<configuration>
101-
<excludes>
102-
<!-- exclude logging config from jar -->
103-
<exclude>**/logback.xml</exclude>
104-
</excludes>
105-
</configuration>
106-
</plugin>
107-
<plugin>
108-
<groupId>org.apache.maven.plugins</groupId>
109-
<artifactId>maven-assembly-plugin</artifactId>
110-
<configuration>
111-
<descriptorRefs>
112-
<descriptorRef>jar-with-dependencies</descriptorRef>
113-
</descriptorRefs>
102+
<skip>${skipTests}</skip>
103+
<includes>
104+
<include>**/*</include>
105+
</includes>
106+
<groups>thredds.server.metadata.Integration</groups>
114107
</configuration>
115108
<executions>
116109
<execution>
117-
<id>make-assembly</id>
118-
<phase>package</phase>
119110
<goals>
120-
<goal>single</goal>
111+
<goal>integration-test</goal>
112+
<goal>verify</goal>
121113
</goals>
122114
</execution>
123115
</executions>
124116
</plugin>
125117
<plugin>
126118
<groupId>org.apache.maven.plugins</groupId>
127-
<artifactId>maven-antrun-plugin</artifactId>
128-
<executions>
129-
<execution>
130-
<id>checksum</id>
131-
<phase>package</phase>
132-
<goals>
133-
<goal>run</goal>
134-
</goals>
135-
<configuration>
136-
<target name="generate_checksum">
137-
<property name="file" value="${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar"/>
138-
<checksum algorithm="md5" file="${file}"/>
139-
<checksum algorithm="sha1" file="${file}"/>
140-
<checksum algorithm="sha-256" fileext=".sha256" file="${file}"/>
141-
</target>
142-
</configuration>
143-
</execution>
144-
</executions>
119+
<artifactId>maven-jar-plugin</artifactId>
120+
<configuration>
121+
<excludes>
122+
<!-- exclude logging config from jar -->
123+
<exclude>**/logback.xml</exclude>
124+
</excludes>
125+
</configuration>
145126
</plugin>
146127
</plugins>
147128
</build>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
4+
*/
5+
6+
package thredds.server.metadata;
7+
8+
public interface Integration { }

tds-plugin/src/test/java/thredds/server/metadata/NcIsoIT.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2023-2025 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
4+
*/
5+
16
package thredds.server.metadata;
27

38
import static com.google.common.truth.Truth.assertThat;
@@ -13,6 +18,7 @@
1318
import org.junit.BeforeClass;
1419
import org.junit.ClassRule;
1520
import org.junit.Test;
21+
import org.junit.experimental.categories.Category;
1622
import org.testcontainers.containers.GenericContainer;
1723
import org.testcontainers.utility.DockerImageName;
1824
import org.testcontainers.utility.MountableFile;
@@ -27,6 +33,7 @@
2733
import ucar.httpservices.HTTPMethod;
2834
import ucar.httpservices.HTTPSession;
2935

36+
@Category(Integration.class)
3037
public class NcIsoIT {
3138
private static final DockerImageName dockerImageName =
3239
DockerImageName.parse("unidata/thredds-docker:" + getTdsVersion());
@@ -39,14 +46,21 @@ public class NcIsoIT {
3946
"/usr/local/tomcat/content/thredds/catalog.xml")
4047
.withCopyFileToContainer(MountableFile.forClasspathResource("/thredds/testgrid1.nc"),
4148
"/usr/local/tomcat/content/thredds/public/testdata/testgrid1.nc")
42-
.withCopyFileToContainer(MountableFile.forHostPath(getJarPath()),
43-
"/usr/local/tomcat/webapps/thredds/WEB-INF/lib/tds-plugin-jar-with-dependencies.jar");
49+
// copy local tds-plugin jar
50+
.withCopyFileToContainer(MountableFile.forHostPath(getJarPath("tds-plugin")),
51+
"/usr/local/tomcat/webapps/thredds/WEB-INF/lib/1-tds-plugin.jar")
52+
// make sure local nciso-common shows up before bundled nciso-common jar by
53+
// prefixing it with 1-
54+
.withCopyFileToContainer(MountableFile.forHostPath(getJarPath("../../nciso-common/target/nciso-common")),
55+
"/usr/local/tomcat/webapps/thredds/WEB-INF/lib/1-nciso-common.jar");
4456

4557
@BeforeClass
46-
public static void setUp() {
58+
public static void setUp() throws IOException, InterruptedException {
4759
final String address = tds.getHost();
4860
final Integer port = tds.getFirstMappedPort();
4961
basePath = "http://" + address + ":" + port + "/thredds/";
62+
// remove bundled tds-plugin classes from the classpath
63+
tds.execInContainer("rm", "-rf", "/usr/local/tomcat/webapps/thredds/WEB-INF/classes/thredds/server/metadata");
5064
}
5165

5266
@Test
@@ -118,11 +132,11 @@ private static String getTdsVersion() {
118132
return getPropertyValue("tds_version");
119133
}
120134

121-
private static Path getJarPath() {
135+
private static Path getJarPath(String name) {
122136
try {
123137
final Path targetPath = Paths.get(ClassLoader.getSystemClassLoader().getResource("").toURI()).getParent();
124-
return Paths.get(targetPath.toString(), "tds-plugin-" + getVersion() + "-jar-with-dependencies.jar");
125-
} catch (URISyntaxException e) {
138+
return Paths.get(targetPath.toRealPath().toString(), name + "-" + getVersion() + ".jar");
139+
} catch (URISyntaxException | IOException e) {
126140
throw new RuntimeException(e);
127141
}
128142
}

0 commit comments

Comments
 (0)