Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Getting error while building maven project " Bundle aem-digital.core:1.0.0-SNAPSHOT is importing package(s) com.fasterxml.jackson.dataformat.csv in start level 20 but no bundle is exporting these for that start level."

codingStar
Level 3
Level 3

Hi All,

 

I have created AEM a cloud project using below archtype

 

mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=30 -D appTitle="Digital Site" -D appId="digitalsite" -D artifactId="aem-digital" -D groupId="com.digital" -D aemVersion=cloud -D includeDispatcherConfig="y"

 

 

I have added some project specific dependency 

 

		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-csv</artifactId>
			<version>2.11.4</version>
		</dependency>

 

 

But while  building the project I am getting error 

 

 

[WARNING] The analyser found the following warnings for author and publish :
[WARNING] [artifact-rules] artifact-rules: Artifact rules are not specified, unable to validate feature
[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] com.digital:aem-digital.core:1.0.0-SNAPSHOT: Bundle aem-digital.core:1.0.0-SNAPSHOT is importing package(s) com.fasterxml.jackson.dataformat.csv in start level 20 but no bundle is exporting these for that start level. (com.digital:aem-digital.all:1.0.0-SNAPSHOT)

 

 

Can please help me here How I can resolve this error??

 

 

 

 

1 Accepted Solution
Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

@codingStar 

This is because of the aemanalyser-maven-plugin that gets executed in all module of the project which run the same checks locally as in the Cloud Manager deployment pipeline. 

Vijayalakshmi_S_1-1638623883632.png

More about the plugin : https://github.com/adobe/aemanalyser-maven-plugin/blob/main/aemanalyser-maven-plugin/README.md

For the reported analyzer error,

Whole list of analyzers that are executed as part of this plugin : https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetyp...

View solution in original post

8 Replies
Jörg_Hoh
Employee
Employee

if you just add the dependency to the pom, this additional JAR is used while compilation and test. But it is not included into the runtime, and therefor this validation process fails.

You either need to embed this dependency into your own bundle, or you find an OSGI-version of that bundle and deploy it along with your core bundle.

codingStar
Level 3
Level 3

Jörg_Hoh I have tried to add below in core pom.xml but still getting same error.

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>4.2.1</version>
    <extensions>true</extensions>
    <configuration>
        <instructions>
            <Export-Package>com.fasterxml.jackson.*</Export-Package>
            <Embed-Dependency>jackson-dataformat-csv;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>
                com.fasterxml.jackson.*
            </Import-Package>
        </instructions>
    </configuration>
</plugin> 

  

Jörg_Hoh
Employee
Employee

I would drop the Export-Package, because you don't want to re-export any jackson package. The Embed-Dependency looks ok, although you can probably omit the scope statement.

 

Can you check if the jackson-dataformat.csv jar is placed within the target/classes folder after the build?

BattiniSravan
Level 4
Level 4

Add the dependency to your core bundle and that should clean this error.

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-csv</artifactId>
</dependency>


I tried it too and the build is successful.

Screenshot 2021-12-03 at 12.54.09 PM.png

codingStar
Level 3
Level 3

@BattiniSravan  I have already added dependency in main pom as well as in core pom gettig error while running below build command

mvn clean install -PautoInstallPackage

Main pom.

		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-csv</artifactId>
			<version>2.11.4</version>
		</dependency>

Core pom

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-csv</artifactId>
            </dependency>
Arun_Patidar
Community Advisor
Community Advisor

Hi,

This error type means

 

Checks if all OSGI bundles have their Import-Package declarations satisfied by the Export-package declaration of other included bundles in the Maven project. An error would look like this:

 

[ERROR] org.acme:mybundle:0.0.1-SNAPSHOT: Bundle org.acme:mybundle:0.0.1-SNAPSHOT is importing package(s) org.acme.foo in start level 20 but no bundle is exporting these for that start level.

 

To troubleshoot, see if the bundle providing the package is included in the deployment, or alternatively look at the manifest of the bundle that you would expect to be exporting to determine if the wrong name or wrong version was used.

 

 

codingStar
Level 3
Level 3

@Arun_Patidar  I am getting this just after adding below dependency which I am using on servlet class. And I am getting this error even run mvn clean install

Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

@codingStar 

This is because of the aemanalyser-maven-plugin that gets executed in all module of the project which run the same checks locally as in the Cloud Manager deployment pipeline. 

Vijayalakshmi_S_1-1638623883632.png

More about the plugin : https://github.com/adobe/aemanalyser-maven-plugin/blob/main/aemanalyser-maven-plugin/README.md

For the reported analyzer error,

Whole list of analyzers that are executed as part of this plugin : https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetyp...