FELIX-479: add supportedProjectTypes configuration option
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@618886 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrCleanRepo.java b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrCleanRepo.java
index 4ac5fdc..f89d08d 100644
--- a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrCleanRepo.java
+++ b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrCleanRepo.java
@@ -54,6 +54,7 @@
/**
* Clean an OBR repository by finding and removing missing resources.
*
+ * @requiresProject false
* @goal clean
* @phase clean
*
diff --git a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeploy.java b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeploy.java
index fb94dfe..7915082 100644
--- a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeploy.java
+++ b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeploy.java
@@ -21,6 +21,8 @@
import java.io.File;
import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -58,6 +60,14 @@
private String obrRepository;
/**
+ * Project types which this plugin supports.
+ *
+ * @parameter
+ */
+ private List supportedProjectTypes = Arrays.asList( new String[]
+ { "jar", "bundle" } );
+
+ /**
* @parameter expression="${project.distributionManagementArtifactRepository}"
* @readonly
*/
@@ -107,7 +117,12 @@
public void execute() throws MojoExecutionException
{
- if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ if ( !supportedProjectTypes.contains( project.getPackaging() ) )
+ {
+ getLog().info( "Ignoring packaging type " + project.getPackaging() );
+ return;
+ }
+ else if ( "NONE".equalsIgnoreCase( obrRepository ) )
{
getLog().info( "OBR update disabled (enable with -DobrRepository)" );
return;
diff --git a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeployFile.java b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeployFile.java
index 046d25b..ca673f0 100644
--- a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeployFile.java
+++ b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrDeployFile.java
@@ -21,6 +21,8 @@
import java.io.File;
import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -56,6 +58,14 @@
private String obrRepository;
/**
+ * Project types which this plugin supports.
+ *
+ * @parameter
+ */
+ private List supportedProjectTypes = Arrays.asList( new String[]
+ { "jar", "bundle" } );
+
+ /**
* Remote repository id, used to lookup authentication settings.
*
* @parameter expression="${repositoryId}" default-value="remote-repository"
@@ -108,7 +118,12 @@
{
MavenProject project = getProject();
- if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ if ( !supportedProjectTypes.contains( project.getPackaging() ) )
+ {
+ getLog().info( "Ignoring packaging type " + project.getPackaging() );
+ return;
+ }
+ else if ( "NONE".equalsIgnoreCase( obrRepository ) )
{
getLog().info( "OBR update disabled (enable with -DobrRepository)" );
return;
diff --git a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrInstallFile.java b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrInstallFile.java
index 757c37a..2b22d57 100644
--- a/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrInstallFile.java
+++ b/maven-obr-plugin/src/main/java/org/apache/felix/obr/plugin/ObrInstallFile.java
@@ -20,6 +20,8 @@
import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.MojoExecutionException;
@@ -46,6 +48,14 @@
private String obrRepository;
/**
+ * Project types which this plugin supports.
+ *
+ * @parameter
+ */
+ private List supportedProjectTypes = Arrays.asList( new String[]
+ { "jar", "bundle" } );
+
+ /**
* Local Repository.
*
* @parameter expression="${localRepository}"
@@ -59,7 +69,12 @@
{
MavenProject project = getProject();
- if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ if ( !supportedProjectTypes.contains( project.getPackaging() ) )
+ {
+ getLog().info( "Ignoring packaging type " + project.getPackaging() );
+ return;
+ }
+ else if ( "NONE".equalsIgnoreCase( obrRepository ) )
{
getLog().info( "OBR update disabled (enable with -DobrRepository)" );
return;