From fa19b51cbc4e4859924f57ffe0bbc374b2b6900c Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 6 Oct 2009 21:47:42 +0000 Subject: Exclude the project itself from the resolution so that it can be built offline git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@822525 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'maven-plugins/trunk/maven-bundle-plugin/src/main') diff --git a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java index 1bac66efc3..52821e5214 100644 --- a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java +++ b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java @@ -765,14 +765,18 @@ public class ModuleBundlesBuildMojo extends AbstractMojo { artifactCollector); CollectingDependencyNodeVisitor visitor = new CollectingDependencyNodeVisitor(); rootNode.accept(visitor); + // Add included artifacts for (Object node : visitor.getNodes()) { DependencyNode depNode = (DependencyNode)node; int state = depNode.getState(); if (state == DependencyNode.INCLUDED ) { Artifact artifact = depNode.getArtifact(); - resolver.resolve(artifact, remoteRepos, local); - artifacts.add(artifact); + // Exclude the project artifact to avoid offline resolution failure + if (!artifact.equals(project.getArtifact())) { + resolver.resolve(artifact, remoteRepos, local); + artifacts.add(artifact); + } } } // Scan for newer versions that are omitted -- cgit v1.2.3