FELIX-340: update classpath algorithm to match maven compilation classpath
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@568393 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/pom.xml b/bundleplugin/pom.xml
index 02cfffb..c4b3966 100644
--- a/bundleplugin/pom.xml
+++ b/bundleplugin/pom.xml
@@ -73,7 +73,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.0</version>
+ <version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 1e79818..4f36806 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -340,21 +340,24 @@
list.add(new Jar(".", this.getOutputDirectory()));
}
- Set artifacts = project.getDependencyArtifacts();
+ Set artifacts = project.getArtifacts();
for (Iterator it = artifacts.iterator(); it.hasNext();)
{
Artifact artifact = (Artifact) it.next();
- if (Artifact.SCOPE_COMPILE.equals(artifact.getScope())
- || Artifact.SCOPE_SYSTEM.equals(artifact.getScope())
- || Artifact.SCOPE_PROVIDED.equals(artifact.getScope()))
+ if (artifact.getArtifactHandler().isAddedToClasspath())
{
- File file = this.getFile(artifact);
- if (file == null)
+ if (Artifact.SCOPE_COMPILE.equals(artifact.getScope())
+ || Artifact.SCOPE_SYSTEM.equals(artifact.getScope())
+ || Artifact.SCOPE_PROVIDED.equals(artifact.getScope()))
{
- throw new RuntimeException("File is not available for artifact " + artifact + " in project " + project.getArtifact());
+ File file = this.getFile(artifact);
+ if (file == null)
+ {
+ throw new RuntimeException("File is not available for artifact " + artifact + " in project " + project.getArtifact());
+ }
+ Jar jar = new Jar(artifact.getArtifactId(), file);
+ list.add(jar);
}
- Jar jar = new Jar(artifact.getArtifactId(), file);
- list.add(jar);
}
}
Jar[] cp = new Jar[list.size()];