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/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e2ef7f  [FELIX-6460] Fix MAVEN_TEST_SOURCES use
4e2ef7f is described below

commit 4e2ef7f16efa376da95abf3eb8f7100d4962c6cc
Author: Jean-Baptiste Onofré <[email protected]>
AuthorDate: Tue Dec 7 15:31:15 2021 +0100

    [FELIX-6460] Fix MAVEN_TEST_SOURCES use
---
 .../src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
 
b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index dcf1489..3a8117f 100644
--- 
a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ 
b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -1647,10 +1647,9 @@ public class BundlePlugin extends AbstractMojo
     {
         List<ClassPathItem> list = new ArrayList<>( 
currentProject.getArtifacts().size() + 1 );
 
-        String d = currentProject.getBuild() != null ? 
currentProject.getBuild().getOutputDirectory() : null;
-        if ( d != null )
+        if ( getOutputDirectory() != null && getOutputDirectory().exists() )
         {
-            list.add( new ClassPathItem( ".", new File( d ) ) );
+            list.add( new ClassPathItem( ".", getOutputDirectory() ) );
         }
 
         final Collection<Artifact> artifacts = 
getSelectedDependencies(currentProject.getArtifacts() );
@@ -2158,7 +2157,7 @@ public class BundlePlugin extends AbstractMojo
         final String sourcePath = analyzer.getProperty( Analyzer.SOURCEPATH );
         if ( sourcePath != null )
         {
-            if ( sourcePath.contains(MAVEN_SOURCES) || 
sourcePath.contains(MAVEN_TEST_RESOURCES) )
+            if ( sourcePath.contains(MAVEN_SOURCES) || 
sourcePath.contains(MAVEN_TEST_SOURCES) )
             {
                 String combinedSource = StringUtils.replace( sourcePath, 
MAVEN_SOURCES, mavenSourcePaths.toString() );
                 combinedSource = StringUtils.replace( combinedSource, 
MAVEN_TEST_SOURCES, mavenTestSourcePaths.toString() );

Reply via email to