0

I have issues with Maven 3 / Intellij .

As you see in this picture , I can't use my custom dependency classes in a new different project. it seems that intellij (same issue with eclipse) does not recognize the class IRunnableTask.java from the dependency scheduler (package : com.sifoklus.scheduler.task) although it's installed in my local maven repository and I can see it in External Libraries view in IntelliJ Screenshot of IntelliJ

Here is my local repository path from setting.xml Screenshot with XML

and the dependency is well installed in the same path : Screenshot of Windows Explorer

and I added this dependency to my new project using : Screenshot of Maven dependencies XML in IntelliJ

Intellij is using the right settings file and the right local repo Screenshot of Maven settings in IntelliJ

I 've already tried to delete cache and restart . the problem is not fixed.

Do you know what is the problem and how it can be resolved ? Thank you

I tried to delete cache and restart . nothing changed

[[EDIT]]

Hello @romanv-jb

the error in 'problem' view says : cannot resolve symbol sifoklus (name of one folder in the package) . If I click more actions : one of the options is Add maven Dependency ,

enter image description here

when I click on this option , the intellij pop up finds the dependency but when I choose it , nothing changes. enter image description here

The code of Interface IRunnableTask is : enter image description here

sifokl
  • 3
  • 7
  • What does IDEA say in the Problems Tool Window? Can you share the exact error message it is giving you? Can you share the "scheduler" artifact or a screenshot/code of how the "IRunnableTask" Interface is declared? – romanv-jb Jul 06 '23 at 08:42
  • Hello @romanv-jb the error in 'problem' view says : cannot resolve symbol sifoklus (name of one folder in the package) . If I click more actions : one of the options is Add maven Dependency , when I click on this option , the intellij pop up finds the dependency but when I choose it , nothing changes. I will update the post with all screenshot . please see the update. thank you – sifokl Jul 07 '23 at 14:48

2 Answers2

0

Few things you can try are:

HypedBuddy
  • 11
  • 1
  • 3
  • hello @HypedBudy I ve already ran mvn clean install -U and the dependency exists in the side bar. but I cant import it in my project. I will check the link you suggested . Thnak you – sifokl Jul 05 '23 at 16:43
  • I ve already removed _remote.repositories file. but problem persists – sifokl Jul 05 '23 at 16:54
0

Judging from the directory structure inside the com.sifoklus:scheduler jar file, it appears the repackage goal of the spring-boot-maven-plugin was run during its build. All the com.sifoklus.* classes should appear at the root rather than under BOOT-INF/classes.

If indeed scheduler has the plugin spring-boot-maven-plugin defined in its POM file, with an execution goal of repackage, try removing this plugin, and rebuild scheduler using mvn clean install.

  • That was the solution. I commented the block in the pom.xml of scheduler. now it does not build a fat jar but it resolves the problem. Thank you very much @Brian for this help – sifokl Jul 07 '23 at 16:16
  • You are welcome @sifokl. Happy I could help. – Brian Schalme Jul 07 '23 at 16:34