You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2018/11/20 09:47:09 UTC
[karaf] branch master updated: [KARAF-5939] Update and support
maven-install-plugin 3.0.0.M1
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/master by this push:
new 61fcf2f [KARAF-5939] Update and support maven-install-plugin 3.0.0.M1
61fcf2f is described below
commit 61fcf2fd8f16d50ac194baed619aac2985f531b9
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Wed Nov 14 15:24:06 2018 +0100
[KARAF-5939] Update and support maven-install-plugin 3.0.0.M1
---
.../src/main/resources/archetype-resources/pom.xml | 5 -----
.../src/main/resources/archetype-resources/pom.xml | 5 -----
.../karaf-maven-example-assembly/pom.xml | 4 ++--
.../karaf-maven-example/karaf-maven-example-kar/pom.xml | 17 +++--------------
.../src/{features => main/feature}/features-repo.xml | 0
pom.xml | 2 +-
.../main/java/org/apache/karaf/tooling/ArchiveMojo.java | 6 +++---
.../karaf/tooling/features/GenerateDescriptorMojo.java | 8 +++++++-
8 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml
index c4c1811..4072ed3 100644
--- a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml
@@ -124,11 +124,6 @@
<version>^project.version^</version>
<extensions>true</extensions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.5.2</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
diff --git a/archetypes/feature/src/main/resources/archetype-resources/pom.xml b/archetypes/feature/src/main/resources/archetype-resources/pom.xml
index 98f5fb8..47a5edc 100644
--- a/archetypes/feature/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/feature/src/main/resources/archetype-resources/pom.xml
@@ -41,11 +41,6 @@
<version>^project.version^</version>
<extensions>true</extensions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.5.2</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
diff --git a/examples/karaf-maven-example/karaf-maven-example-assembly/pom.xml b/examples/karaf-maven-example/karaf-maven-example-assembly/pom.xml
index 78c3e6e..1fa8861 100644
--- a/examples/karaf-maven-example/karaf-maven-example-assembly/pom.xml
+++ b/examples/karaf-maven-example/karaf-maven-example-assembly/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.karaf.examples</groupId>
<artifactId>karaf-maven-example</artifactId>
- <version>4.2.1-SNAPSHOT</version>
+ <version>4.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -81,4 +81,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/examples/karaf-maven-example/karaf-maven-example-kar/pom.xml b/examples/karaf-maven-example/karaf-maven-example-kar/pom.xml
index 36371ec..ddc8712 100644
--- a/examples/karaf-maven-example/karaf-maven-example-kar/pom.xml
+++ b/examples/karaf-maven-example/karaf-maven-example-kar/pom.xml
@@ -24,13 +24,13 @@
<parent>
<groupId>org.apache.karaf.examples</groupId>
<artifactId>karaf-maven-example</artifactId>
- <version>4.2.1-SNAPSHOT</version>
+ <version>4.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>karaf-maven-example-kar</artifactId>
<name>Apache Karaf :: Examples :: Maven :: KAR</name>
- <packaging>pom</packaging>
+ <packaging>kar</packaging>
<build>
<plugins>
@@ -38,18 +38,7 @@
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>${project.version}</version>
- <executions>
- <execution>
- <id>kar</id>
- <goals>
- <goal>kar</goal>
- </goals>
- <configuration>
- <!-- <classifier>my</classifier> -->
- <featuresFile>${basedir}/src/features/features-repo.xml</featuresFile>
- </configuration>
- </execution>
- </executions>
+ <extensions>true</extensions>
</plugin>
</plugins>
</build>
diff --git a/examples/karaf-maven-example/karaf-maven-example-kar/src/features/features-repo.xml b/examples/karaf-maven-example/karaf-maven-example-kar/src/main/feature/features-repo.xml
similarity index 100%
rename from examples/karaf-maven-example/karaf-maven-example-kar/src/features/features-repo.xml
rename to examples/karaf-maven-example/karaf-maven-example-kar/src/main/feature/features-repo.xml
diff --git a/pom.xml b/pom.xml
index ecc4d0d..f457fc6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1829,7 +1829,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
- <version>2.5.2</version>
+ <version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
index a906dae..2e03ba7 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
@@ -113,9 +113,6 @@ public class ArchiveMojo extends MojoSupport {
private boolean useSymLinks = false;
public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().debug("Setting artifact file: " + targetFile);
- org.apache.maven.artifact.Artifact artifact = project.getArtifact();
- artifact.setFile(targetFile);
try {
//now pack up the server.
if(archiveTarGz){
@@ -146,6 +143,9 @@ public class ArchiveMojo extends MojoSupport {
if (attach) {
projectHelper.attachArtifact(project, artifact1.getType(), classifier, target1);
}
+
+ artifact1.setFile(target1);
+ project.setArtifact(artifact1);
}
public File archive(File source, File dest, Artifact artifact) throws //ArchiverException,
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
index b644540..8906622 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
@@ -342,7 +342,12 @@ public class GenerateDescriptorMojo extends MojoSupport {
throw new MojoExecutionException("Could not create directory for features file: " + dir);
}
filter(inputFile, outputFile);
- projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
+ getLog().info("Generation not enabled");
+ getLog().info("Attaching artifact");
+ //projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
+ Artifact artifact = factory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), attachmentArtifactType, attachmentArtifactClassifier);
+ artifact.setFile(outputFile);
+ project.setArtifact(artifact);
return;
}
}
@@ -357,6 +362,7 @@ public class GenerateDescriptorMojo extends MojoSupport {
try (PrintStream out = new PrintStream(new FileOutputStream(outputFile))) {
writeFeatures(out);
}
+ getLog().info("Attaching features XML");
// now lets attach it
projectHelper.attachArtifact(project, attachmentArtifactType, attachmentArtifactClassifier, outputFile);
} else {