Hi all,
I'm facing a very strange behaviour that *might* be related to SCR
(I'm not sure, so Carsten - if you're reading this - please forgive me).

The project I'm working on is divided into several Maven modules.
The modules I maintain use the maven-scr-plugin (v1.4.2)
and the SCR Java annotations dependency (v1.2.0) to create the
Component Descriptor and to inject OSGi services (a.k.a
"references" in DS terms).

When I build the whole project it seems that the scr goal does not generate the Service Component Descriptor:

[INFO] Building Dgm Console
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\Users\Guido\[snipped]\DgmConsole\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to C:\Users\Guido\[snipped]\DgmConsole\target\classes
[INFO] [scr:scr {execution: generate-scr-scrdescriptor}]
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [bundle:bundle]
[ERROR] Error building bundle org.[snipped]:DgmConsole:bundle:0.3.0.2 : Not found Service-Component header: OSGI-INF/DgmConsole.xml [ERROR] Error building bundle org.[snipped]:DgmConsole:bundle:0.3.0.2 : Service-Component entry can not be located in JAR: OSGI-INF/DgmConsole.xml
[ERROR] Error(s) found in bundle configuration

On the other hand, if I launch the same command directly from within the failing module directory OR if I comment out all the other modules, just leaving the failing ones in the parent POM, it all works perfectly:

[INFO] ------------------------------------------------------------------------
[INFO] Building Dgm Console
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\Users\Guido\[snipped]\DgmConsole\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to C:\Users\Guido\[snipped]\DgmConsole\target\classes
[INFO] [scr:scr {execution: generate-scr-scrdescriptor}]
[INFO] Writing abstract service descriptor C:\Users\Guido\[snipped]\DgmConsole\target\scr-plugin-generated\OSGI-INF\scr-plugin\scrinfo.xml with 1 entries. [INFO] Generating 1 Service Component Descriptors to C:\Users\Guido\[snipped]\DgmConsole\target\scr-plugin-generated\OSGI-INF\DgmConsole.xml
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [bundle:bundle]
[INFO] [install:install]
[INFO] Installing C:\Users\Guido\[snipped]\DgmConsole\target\DgmConsole-0.3.0.2.jar to C:\Users\Guido\.m2\repository\[snipped]\DgmConsole\0.3.0.2\DgmConsole-0.3.0.2.jar
[INFO] [bundle:install]
[INFO] Parsing file:/C:/Users/Guido/.m2/repository/repository.xml
[INFO] Installing [snipped]/DgmConsole/0.3.0.2/DgmConsole-0.3.0.2.jar
[INFO] Writing OBR metadata


The failing modules are "leaves" in the dependency tree, so they're built last
(don't know if this is meaningful, just shooting in the dark).

I can provide more logs if required.


Thank you,
Guido

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to