Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Fix maven-scr-plugin does not generate XML for DS annotations in test…
Browse files Browse the repository at this point in the history
… bundles (#6214)

The maven-resources-plugin is used to copy back the generated XML to the OSGI-INF directory so it is on the classpath in tests.
The outputDirectory configuration parameter of the maven-scr-plugin is not used because when it is set to ${project.basedir} it empties the OSGI-INF dir and would remove non-generated SCR XML files.

Signed-off-by: Wouter Born <eclipse@maindrain.net>
  • Loading branch information
wborn authored and kaikreuzer committed Sep 16, 2018
1 parent 0d95322 commit db1d88d
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 58 deletions.
@@ -0,0 +1 @@
/*.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 21 additions & 0 deletions bundles/pom.xml
Expand Up @@ -62,6 +62,27 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<outputDirectory>${project.basedir}/OSGI-INF</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.basedir}/target/classes/OSGI-INF</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
@@ -0,0 +1 @@
/*.xml

This file was deleted.

Expand Up @@ -26,7 +26,7 @@
*
* @author Jan N. Klug - Initial contribution
*/
@Component(service = ThingHandlerFactory.class, immediate = true, name = "binding.dmx.test")
@Component(service = ThingHandlerFactory.class)
public class DmxTestHandlerFactory extends BaseThingHandlerFactory {

@Override
Expand Down
21 changes: 21 additions & 0 deletions extensions/pom.xml
Expand Up @@ -60,6 +60,27 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<outputDirectory>${project.basedir}/OSGI-INF</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.basedir}/target/classes/OSGI-INF</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -176,6 +176,7 @@
<configuration>
<supportedProjectTypes>
<supportedProjectType>eclipse-plugin</supportedProjectType>
<supportedProjectType>eclipse-test-plugin</supportedProjectType>
</supportedProjectTypes>
</configuration>
</plugin>
Expand Down

0 comments on commit db1d88d

Please sign in to comment.