Hi,
I am trying to make available the OSGi Service of one Maven project inside another Maven project's Servlet locally, by adding the dependency of the imported project into the importing project per below:
pom.xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.exporter.aem</groupId>
<artifactId>exporter-pages.core</artifactId>
<version>2.9.0</version>
<scope>provided</scope>
</dependency>
// other dependencies...
</dependencies>
</dependencyManagement>
core/pom.xml
<dependencies>
<dependency>
<groupId>com.exporter.aem</groupId>
<artifactId>exporter-pages.core</artifactId>
</dependency>
// other dependencies...
</dependencies>
The imported project is already installed/deployed, and my Servlet code was able to import the package `com.importer.aem.core.services.MyOSGiService` fine. But when I try to deploy using `mvn clean install -PautoInstallPackage -e`, I get the following message:
[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] com.importer.aem:importer-aem-project.core:5.0.0-SNAPSHOT: Bundle importer-aem-project.core:5.0.0-SNAPSHOT is importing package(s) [com.exporter.aem.core.services, com.exporter.aem.core.exceptions] in start level 20 but no bundle is exporting these for that start level. (IMPORTER:importer-aem-project.importer.all:5.0.0-SNAPSHOT)
If I disable the plugin at root pom.xml using code below, then the error disappears, and my Servlet is able to use the OSGi service fine. But of course I don't want to skip it.
<aemanalyser.version>1.5.8</aemanalyser.version>
<aem.analyser.skip>true</aem.analyser.skip>
Solved! Go to Solution.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies