AEM 6.5 - Can't import dependency to my AEM project | Community
Skip to main content
Level 2
October 10, 2022

AEM 6.5 - Can't import dependency to my AEM project

  • October 10, 2022
  • 3 replies
  • 3103 views

Hello there.
I'm totally new to this world, same for Maven/Java so please be kind with me. I'm trying to import Opencsv to my project since I've to read some csv files and I saw it's easy to implement. I tell you what I'm currently doing to import it:
- Went to Maven online repository > Opencsv

- Added this snippet in my core pom.xml

- Wrote some code to read my csv
Tried to build but I got this error:
[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] it.censored:aem-censored-project.core:1.0.0-SNAPSHOT: Bundle aem-censored-project.core:1.0.0-SNAPSHOT is importing package(s) [com.opencsv.exceptions, com.opencsv, com.opencsv.bean] in start level 20 but no bundle is exporting these for that start level. (it.censored:aem-censored-project.all:1.0.0-SNAPSHOT).


At first I thought maybe this dep was not compatible with my project and I tried to add a similar dep but same result. Can you help me? What am I doing wrong? I can screenshare or post more info if you need it. Thanks

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Saravanan_Dharmaraj
Community Advisor
Community Advisor
October 10, 2022

In your core pom.xml , could you try Embed Dependency along with other configuration and see?

 

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>commons-csv</Embed-Dependency>

 

LezzowskiAuthor
Level 2
October 10, 2022

Thanks for your answer, I added this snippet here(the green part), but same error. If it's ok to you I can screenshare it so I can show it you better.

 

LezzowskiAuthor
Level 2
October 10, 2022

Thank you for your answer, I already saw that post but I don't really know if I did something wrong. It would be easier for me if I could show you my screen!

 

B_Sravan
Community Advisor
Community Advisor
October 10, 2022

Hi @lezzowski ,

 

please add this dependency on the main pom file:

<!-- Open CSV Dependencies -->
            <dependency>
                <groupId>com.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>5.7.0</version>
            </dependency>

add this to your core pom file:

<dependency>
       <groupId>com.opencsv</groupId>
       <artifactId>opencsv</artifactId>
</dependency>

Try importing your project to a IDE, IntelliJ/Eclipse which could resolve dependencies by downloading the dependencies before the build.

LezzowskiAuthor
Level 2
October 10, 2022

Hello @b_sravan ,

I'm using IntelliJ but unfortunately I'm still receiving the same error. If it's ok to you I can screenshare, I'll wait for your reply 😁

 

 

B_Sravan
Community Advisor
Community Advisor
October 11, 2022

sure, please DM me, we can connect and look into the issue.