diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-19 13:40:35 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-20 13:15:21 +0200 |
commit | 43298ad59815c9731e0d2f0cd8604af08a119021 (patch) | |
tree | d8b3a52ec2d618e66f107181a5c791ba63ec5b07 /bundle-plugin | |
parent | 94e3449f4b57647b199a03e2e59f91ee902b35eb (diff) |
Rewrite ProjectBundleClassPaths to Java
Diffstat (limited to 'bundle-plugin')
-rw-r--r-- | bundle-plugin/pom.xml | 2 | ||||
-rw-r--r-- | bundle-plugin/src/main/scala/com/yahoo/container/plugin/mojo/GenerateBundleClassPathMappingsMojo.scala | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/bundle-plugin/pom.xml b/bundle-plugin/pom.xml index 31355ff21d2..60facd877ed 100644 --- a/bundle-plugin/pom.xml +++ b/bundle-plugin/pom.xml @@ -74,7 +74,7 @@ </dependency> <dependency> <groupId>com.yahoo.vespa</groupId> - <artifactId>scalalib</artifactId> + <artifactId>vespajlib</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/bundle-plugin/src/main/scala/com/yahoo/container/plugin/mojo/GenerateBundleClassPathMappingsMojo.scala b/bundle-plugin/src/main/scala/com/yahoo/container/plugin/mojo/GenerateBundleClassPathMappingsMojo.scala index cad91e00684..4f463e7b494 100644 --- a/bundle-plugin/src/main/scala/com/yahoo/container/plugin/mojo/GenerateBundleClassPathMappingsMojo.scala +++ b/bundle-plugin/src/main/scala/com/yahoo/container/plugin/mojo/GenerateBundleClassPathMappingsMojo.scala @@ -6,14 +6,15 @@ import java.nio.file.Paths import com.google.common.base.Preconditions import com.yahoo.container.plugin.bundle.AnalyzeBundle -import com.yahoo.vespa.scalalib.osgi.maven.ProjectBundleClassPaths -import ProjectBundleClassPaths.BundleClasspathMapping -import com.yahoo.vespa.scalalib.osgi.maven.ProjectBundleClassPaths +import com.yahoo.osgi.maven.ProjectBundleClassPaths +import com.yahoo.osgi.maven.ProjectBundleClassPaths.BundleClasspathMapping import org.apache.maven.artifact.Artifact import org.apache.maven.plugin.AbstractMojo -import org.apache.maven.plugins.annotations.{ResolutionScope, Mojo, Parameter} +import org.apache.maven.plugins.annotations.{Mojo, Parameter, ResolutionScope} import org.apache.maven.project.MavenProject +import scala.collection.JavaConverters._ + /** @@ -61,13 +62,12 @@ class GenerateBundleClassPathMappingsMojo extends AbstractMojo { val classPathElements = (outputDirectory +: embeddedArtifactsFiles).map(_.getAbsolutePath) - val classPathMappings = ProjectBundleClassPaths( - mainBundle = BundleClasspathMapping(bundleSymbolicName, classPathElements), - providedDependencies = providedJarArtifacts flatMap createDependencyClasspathMapping - ) + val classPathMappings = new ProjectBundleClassPaths( + new BundleClasspathMapping(bundleSymbolicName, classPathElements.asJava), + providedJarArtifacts.flatMap(createDependencyClasspathMapping).asJava) ProjectBundleClassPaths.save( - testOutputPath.resolve(ProjectBundleClassPaths.classPathMappingsFileName), + testOutputPath.resolve(ProjectBundleClassPaths.CLASSPATH_MAPPINGS_FILENAME), classPathMappings) } @@ -82,7 +82,7 @@ class GenerateBundleClassPathMappingsMojo extends AbstractMojo { */ def createDependencyClasspathMapping(artifact: Artifact): Option[BundleClasspathMapping] = { for (bundleSymbolicName <- bundleSymbolicNameForArtifact(artifact)) - yield BundleClasspathMapping(bundleSymbolicName, classPathElements = List(artifact.getFile.getAbsolutePath)) + yield new BundleClasspathMapping(bundleSymbolicName, List(artifact.getFile.getAbsolutePath).asJava) } def bundleSymbolicNameForArtifact(artifact: Artifact): Option[String] = { |