SLING-7518 - Deploying a new Sling bundle project from the create bundle
wizard fails: Add and remove cannot both be null/empty
Detect project using the bnd-maven-plugin as bundle projects.
diff --git a/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java b/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
index d6caf18..a3e0d3e 100644
--- a/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
+++ b/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
@@ -23,6 +23,7 @@
import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
import org.apache.sling.ide.eclipse.ui.wizards.AbstractNewSlingApplicationWizard;
import org.apache.sling.ide.eclipse.ui.wizards.Projects;
import org.eclipse.core.resources.IFile;
@@ -40,6 +41,17 @@
private ChooseArchetypeWizardPage chooseArchetypePage;
private ArchetypeParametersWizardPage archetypeParametersPage;
+ private static boolean isConfiguredWithBndPlugin(Model model) {
+ for ( Plugin buildPlugin: model.getBuild().getPlugins() ) {
+ if ( "biz.aQute.bnd".equals(buildPlugin.getGroupId())
+ && "bnd-maven-plugin".equals(buildPlugin.getArtifactId()) ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public abstract boolean acceptsArchetype(Archetype archetype);
/**
@@ -118,7 +130,7 @@
if ("content-package".equals(packaging)) {
projects.getContentProjects().add(project);
- } else if ("bundle".equals(packaging)) {
+ } else if ("bundle".equals(packaging) || isConfiguredWithBndPlugin(model)) {
projects.getBundleProjects().add(project);
} else if ("pom".equals(packaging)) {
if (projects.getReactorProject() == null) {