Stefan Seifert created SLING-6572:
-------------------------------------

             Summary: Generate SCR metadata required for mock-based unit tests
                 Key: SLING-6572
                 URL: https://issues.apache.org/jira/browse/SLING-6572
             Project: Sling
          Issue Type: Improvement
          Components: General
    Affects Versions: Parent 29
            Reporter: Stefan Seifert
            Assignee: Stefan Seifert
             Fix For: Parent 30


when unit tests are based on osgi-mock the SCR metadata generated for the OSGi 
components of the project itself needs to be present in the generated classpath 
before the unit test run.

the following {{maven-bundle-plugin}} configuration is required for this:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <!-- Export SCR metadata to classpath to have them available in unit tests 
-->
    <exportScr>true</exportScr>
</configuration>
<executions>
    <!-- Configure extra execution of 'manifest' in process-classes phase to 
make sure SCR metadata is generated before unit test runs -->
    <execution>
        <id>scr-metadata</id>
        <goals>
            <goal>manifest</goal>
        </goals>
        <configuration>
            <supportIncrementalBuild>true</supportIncrementalBuild>
        </configuration>
    </execution>
</executions>
{code}

we should add it by default to the global parent pom.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to