diff options
author | gjoranv <gjoranv@gmail.com> | 2023-05-25 22:56:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-25 22:56:42 +0200 |
commit | 5f0b4c0461d74738e4969e97563d4a7c962f2174 (patch) | |
tree | 91edc865b89d18cdf278cb192b0b6841c907bd70 | |
parent | 876c38e020d11f3707ba661536774cb5d69e5c1f (diff) | |
parent | 5341e60a1f0fb0c47ad45b92f7e9622c3a9612da (diff) |
Merge pull request #27213 from vespa-engine/bundle-type
Bundle type
-rw-r--r-- | bundle-plugin-test/test-bundles/main/pom.xml | 1 | ||||
-rw-r--r-- | bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java | 2 | ||||
-rw-r--r-- | bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java | 26 | ||||
-rwxr-xr-x | component/pom.xml | 3 | ||||
-rw-r--r-- | config-bundle/pom.xml | 3 | ||||
-rw-r--r-- | config-lib/pom.xml | 3 | ||||
-rwxr-xr-x | config/pom.xml | 3 | ||||
-rw-r--r-- | configdefinitions/pom.xml | 3 | ||||
-rw-r--r-- | container-core/pom.xml | 3 | ||||
-rw-r--r-- | container-disc/pom.xml | 1 | ||||
-rw-r--r-- | container-documentapi/pom.xml | 3 | ||||
-rw-r--r-- | container-onnxruntime/pom.xml | 3 | ||||
-rw-r--r-- | container-search-and-docproc/pom.xml | 3 | ||||
-rw-r--r-- | defaults/pom.xml | 19 | ||||
-rw-r--r-- | fsa/pom.xml | 3 | ||||
-rw-r--r-- | hosted-zone-api/pom.xml | 3 | ||||
-rw-r--r-- | jrt/pom.xml | 3 | ||||
-rw-r--r-- | linguistics/pom.xml | 3 | ||||
-rw-r--r-- | model-evaluation/pom.xml | 3 | ||||
-rw-r--r-- | opennlp-linguistics/pom.xml | 3 | ||||
-rw-r--r-- | searchlib/pom.xml | 3 | ||||
-rw-r--r-- | vdslib/pom.xml | 3 | ||||
-rw-r--r-- | vespajlib/pom.xml | 3 | ||||
-rw-r--r-- | vespalog/pom.xml | 3 |
24 files changed, 95 insertions, 11 deletions
diff --git a/bundle-plugin-test/test-bundles/main/pom.xml b/bundle-plugin-test/test-bundles/main/pom.xml index b5f8f7b9a6a..603e0e95aa4 100644 --- a/bundle-plugin-test/test-bundles/main/pom.xml +++ b/bundle-plugin-test/test-bundles/main/pom.xml @@ -34,6 +34,7 @@ <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> <configuration> + <bundleType>INTERNAL</bundleType> <Import-Package> manualImport.withoutVersion, manualImport.withVersion;version="12.3.4", diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java index a1d3cd13b3a..bb2d61932f3 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java @@ -25,7 +25,7 @@ import java.util.jar.JarFile; */ @Mojo(name = "assemble-container-plugin", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) public class AssembleContainerPluginMojo extends AbstractAssembleBundleMojo { - private static enum Dependencies { + private enum Dependencies { WITH, WITHOUT } diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java index 21eba6a283a..2781decdf79 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java @@ -38,6 +38,12 @@ import static com.yahoo.container.plugin.util.Files.allDescendantFiles; @Mojo(name = "generate-osgi-manifest", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true) public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { + private enum BundleType { + CORE, // up to container-dev + INTERNAL, // other vespa bundles (need not be set for groupId 'com.yahoo.vespa') + USER + } + @Parameter private String discApplicationClass = null; @@ -56,6 +62,9 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { @Parameter(alias = "Main-Class") private String mainClass = null; + @Parameter(alias = "Bundle-Type") + private BundleType bundleType = BundleType.USER; + @Parameter(defaultValue = "false") private boolean buildLegacyVespaPlatformBundle; @@ -90,8 +99,8 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { // jdisc_core being provided guarantees that log output does not contain its exported packages logMissingPackages(exportedPackagesFromProvidedDeps, projectPackages, compileJarsPackages, includedPackages); } else { - getLog().warn("This project does not have jdisc_core as provided dependency, so the " + - "generated 'Import-Package' OSGi header may be missing important packages."); + getLog().warn(("This project does not have '%s' as provided dependency, so the generated 'Import-Package' " + + "OSGi header may be missing important packages.").formatted(wantedProvidedDependency())); } logOverlappingPackages(projectPackages, exportedPackagesFromProvidedDeps); logUnnecessaryPackages(compileJarsPackages, exportedPackagesFromProvidedDeps); @@ -110,6 +119,19 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { } } + private String wantedProvidedDependency() { + return switch (effectiveBundleType()) { + case CORE -> "jdisc_core"; + case INTERNAL -> "container-dev"; + case USER -> "container"; + }; + } + + private BundleType effectiveBundleType() { + if (bundleType != BundleType.USER) return bundleType; + return project.getGroupId().equals("com.yahoo.vespa") ? BundleType.INTERNAL : BundleType.USER; + } + private void addAdditionalManifestProperties(Map<String, String> manifestContent, PackageTally includedPackages) { addIfNotEmpty(manifestContent, "X-JDisc-PublicApi-Package", publicApi(includedPackages)); addIfNotEmpty(manifestContent, "Bundle-Activator", bundleActivator); diff --git a/component/pom.xml b/component/pom.xml index e8cee594066..3c3a84b13d4 100755 --- a/component/pom.xml +++ b/component/pom.xml @@ -67,6 +67,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> diff --git a/config-bundle/pom.xml b/config-bundle/pom.xml index a1770537a3e..817820c95d5 100644 --- a/config-bundle/pom.xml +++ b/config-bundle/pom.xml @@ -70,6 +70,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> </plugins> </build> diff --git a/config-lib/pom.xml b/config-lib/pom.xml index 66603deeb38..dce2092a0e1 100644 --- a/config-lib/pom.xml +++ b/config-lib/pom.xml @@ -69,6 +69,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>com.yahoo.vespa</groupId> diff --git a/config/pom.xml b/config/pom.xml index 83a25b8631d..29323e26b0b 100755 --- a/config/pom.xml +++ b/config/pom.xml @@ -176,6 +176,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/configdefinitions/pom.xml b/configdefinitions/pom.xml index 51221c4899f..d70a595e495 100644 --- a/configdefinitions/pom.xml +++ b/configdefinitions/pom.xml @@ -32,6 +32,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/container-core/pom.xml b/container-core/pom.xml index 5fed4f02912..eec8b60077b 100644 --- a/container-core/pom.xml +++ b/container-core/pom.xml @@ -445,6 +445,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/container-disc/pom.xml b/container-disc/pom.xml index 173979fbe81..16ce99220f1 100644 --- a/container-disc/pom.xml +++ b/container-disc/pom.xml @@ -186,6 +186,7 @@ <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> <configuration> + <bundleType>CORE</bundleType> <discApplicationClass>com.yahoo.container.jdisc.ConfiguredApplication</discApplicationClass> <buildLegacyVespaPlatformBundle>true</buildLegacyVespaPlatformBundle> <discPreInstallBundle> diff --git a/container-documentapi/pom.xml b/container-documentapi/pom.xml index 9a2572a9918..b2b795a35f2 100644 --- a/container-documentapi/pom.xml +++ b/container-documentapi/pom.xml @@ -45,6 +45,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> </plugins> </build> diff --git a/container-onnxruntime/pom.xml b/container-onnxruntime/pom.xml index 59d23e1b8c1..b4a4ace380d 100644 --- a/container-onnxruntime/pom.xml +++ b/container-onnxruntime/pom.xml @@ -45,6 +45,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/container-search-and-docproc/pom.xml b/container-search-and-docproc/pom.xml index 470c1b1fa6f..71d547ecacd 100644 --- a/container-search-and-docproc/pom.xml +++ b/container-search-and-docproc/pom.xml @@ -229,6 +229,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/defaults/pom.xml b/defaults/pom.xml index 4a5299e1782..925232d42ec 100644 --- a/defaults/pom.xml +++ b/defaults/pom.xml @@ -50,17 +50,20 @@ <build> <plugins> <plugin> - <groupId>com.yahoo.vespa</groupId> - <artifactId>bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> + <groupId>com.yahoo.vespa</groupId> + <artifactId>bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> + </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/fsa/pom.xml b/fsa/pom.xml index 5d18bdb666c..a3ce38fbeb8 100644 --- a/fsa/pom.xml +++ b/fsa/pom.xml @@ -40,6 +40,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/hosted-zone-api/pom.xml b/hosted-zone-api/pom.xml index 4227d457c4d..bd5b759e972 100644 --- a/hosted-zone-api/pom.xml +++ b/hosted-zone-api/pom.xml @@ -51,6 +51,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>com.yahoo.vespa</groupId> diff --git a/jrt/pom.xml b/jrt/pom.xml index 926756da4a0..68903ae161d 100644 --- a/jrt/pom.xml +++ b/jrt/pom.xml @@ -50,6 +50,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/linguistics/pom.xml b/linguistics/pom.xml index bfbf1beeaea..1ba6e34951e 100644 --- a/linguistics/pom.xml +++ b/linguistics/pom.xml @@ -65,6 +65,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/model-evaluation/pom.xml b/model-evaluation/pom.xml index 7c2ee046556..1e0ac4debbd 100644 --- a/model-evaluation/pom.xml +++ b/model-evaluation/pom.xml @@ -90,6 +90,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>com.yahoo.vespa</groupId> diff --git a/opennlp-linguistics/pom.xml b/opennlp-linguistics/pom.xml index a7907ba212f..90f41c595df 100644 --- a/opennlp-linguistics/pom.xml +++ b/opennlp-linguistics/pom.xml @@ -63,6 +63,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/searchlib/pom.xml b/searchlib/pom.xml index 5555c83adde..d45ced84cea 100644 --- a/searchlib/pom.xml +++ b/searchlib/pom.xml @@ -79,6 +79,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/vdslib/pom.xml b/vdslib/pom.xml index e966d8ce6b6..cc0d1788fdd 100644 --- a/vdslib/pom.xml +++ b/vdslib/pom.xml @@ -47,6 +47,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> diff --git a/vespajlib/pom.xml b/vespajlib/pom.xml index 9b10f82c986..04f044622b2 100644 --- a/vespajlib/pom.xml +++ b/vespajlib/pom.xml @@ -104,6 +104,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> diff --git a/vespalog/pom.xml b/vespalog/pom.xml index f8260471fa2..cb20f4c8358 100644 --- a/vespalog/pom.xml +++ b/vespalog/pom.xml @@ -49,6 +49,9 @@ <groupId>com.yahoo.vespa</groupId> <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> + <configuration> + <bundleType>CORE</bundleType> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> |