JUnit: Service-Component entry can not be located in JAR: OSGI-INF/component.xml
Hello,
whenever I run a JUnit from IntelliJ shortcut I get the following error:
"Service-Component entry can not be located in JAR: OSGI-INF/component.xml"
I tried to open the produced jar and actually there is no OSGI-INF/compoment.xml file in it, but I never had the necessity to change the pom.xml to run JUnit or something.
References: https://www.jetbrains.com/help/idea/performing-tests.html#add-testing-libraries
This is a maven project which is correctly producing the build (jar) and performs all the JUnit tests during the build. I tried to do the same (similar approach) on another IDE and I have no problem.
I'm dealing with OSGi and for some reason I cannot run tests anymore since few days. I installed these two plugins but even removing them, no luck!
- Eclipse PDE Partial
- OSGi
I also have:
- Unit File Support (systemd)
- SonarLint
- GitToolBox
and many more which I think they are bundled with IntelliJ setup.
Could somebody help me please?
Please sign in to leave a comment.
Hello,
If possible can you please create a sample project where you experience the problem and attach it to the issue created at: https://youtrack.jetbrains.com/issues/IDEA
Thank you
Hello!
I have found a solution.
Basically, such build before run, was breaking JUnit Tests.
Hello everyone!
I have found the final solution for this problem.
Go to module settings -> Project Settings -> Facets -> (select the OSGi bundle) -> Under Bundle Creation just select "Create manifest from facet settings and bundle using facet configuration":
Hope it helps someone else!