aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2022-01-13 11:57:54 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2022-01-13 11:57:54 +0100
commitcfdd42d95c39a064abaacd659bf0e09a206aa818 (patch)
tree9b2ce2906151eae5a4a1118a04b94660ecaec20c /config-model/src/test
parentd4c30771a13f9f3df9edf234fe324ca4dad8b3cb (diff)
Warn on deprecated Maven artifacts in pom.xml
Also change deprecated bundle logic to use regex matcher for Java package name.
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/MANIFEST.MF7
-rw-r--r--config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/maven/com.yahoo.test/mybundle/pom.xml15
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java14
3 files changed, 36 insertions, 0 deletions
diff --git a/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/MANIFEST.MF b/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..1f88a5e6477
--- /dev/null
+++ b/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Created-By: 1.6.0_20 (Apple Inc.)
+Bundle-ManifestVersion: 2
+Bundle-Name: mybundle
+Bundle-SymbolicName: mybundle
+Bundle-Version: 0
+
diff --git a/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/maven/com.yahoo.test/mybundle/pom.xml b/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/maven/com.yahoo.test/mybundle/pom.xml
new file mode 100644
index 00000000000..1d28f307824
--- /dev/null
+++ b/config-model/src/test/cfg/application/validation/testjars/pom-xml-warnings/META-INF/maven/com.yahoo.test/mybundle/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.yahoo.test</groupId>
+ <artifactId>mybundle</artifactId>
+ <packaging>container-plugin</packaging>
+ <version>1.0.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>vespa-http-client-extensions</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java
index ae508c6a388..5532a2d1e3a 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java
@@ -69,6 +69,20 @@ public class BundleValidatorTest {
"The org.json library will no longer provided by jdisc runtime on Vespa 8. See https://docs.vespa.ai/en/vespa8-release-notes.html#container-runtime.");
}
+ @Test
+ public void outputs_deploy_warning_on_deprecated_dependency() throws IOException {
+ StringBuffer buffer = new StringBuffer();
+ DeployLogger logger = createDeployLogger(buffer);
+ BundleValidator validator = new BundleValidator();
+ JarFile jarFile = createTemporaryJarFile("pom-xml-warnings");
+ validator.validateJarFile(logger, jarFile);
+ assertThat(buffer.toString())
+ .contains("For pom.xml in 'pom-xml-warnings.jar': \n" +
+ "The dependency com.yahoo.vespa:vespa-http-client-extensions is listed below dependencies. \n" +
+ "The 'vespa-http-client-extensions' artifact will be removed in Vespa 8. " +
+ "Programmatic use can be safely removed from system/staging tests. See internal Vespa 8 release notes for details.");
+ }
+
private JarFile createTemporaryJarFile(String testArtifact) throws IOException {
Path jarFile = tempDir.newFile(testArtifact + ".jar").toPath();
Path artifactDirectory = Paths.get("src/test/cfg/application/validation/testjars/" + testArtifact);