Avatar billede fredand Forsker
10. maj 2016 - 15:44 Der er 1 løsning

How to configuer Eclipse from pom.xml for xsd dependencies?

Hello Guys!

We got a maven-project-structure that we imprt to Eclipse (Mars).
The structure looks like:

a1
-b1(Java)
-b2
-b3
--c1(xsd)
--c2(xsd)
--c3(java)

a1 is parent to all b:s, and b3 is parent to all c:s

c3 got dependencies to b1, c1, c2.

c3 is a rich client.

The problem is that when we run c3 from within Eclipse, Eclipse can not find classes from c1, and c2.
When we look at the buildpath in Eclipse, b1 is refered as a jar from the m2-repo, but c1 and c2 is refered as projects.
If we manually configure the buildpath to refere to c1 and c2 as jar:s from the m2-repo all is working fine.

But of course we would like to have this configured from the pom.xml instead of manually need to set this in Eclipse.

Do you guys know how to fix this or would you advice us to do this in some other way?

Best regards
Fredrik
Avatar billede fredand Forsker
25. oktober 2016 - 21:04 #1
Hello!
I actually ran into another problem regarding ClassNotFoundException:
schemaorg_apache_xmlbeans.system ... TypeSystemHolder

Project "a" could not run from within Eclipse since it depended on generated classes inside the jar from the project "b" even tough the b.jar was present with all classes in my repo.

The problem was that when I had all projects (a and b) open in Eclipse, when I ran mvn eclipse:eclipse, maven insisted to create a .classpath with a classpathentry kind="src" for project b in buildpath for project a.

I closed/removed project b, ran mvn eclipse:eclipse again and this time my classpath entry was correct, kind="var", in other word pointing to the jar in my repo!!!

Now I also could import project B again.

So I bet this is why c1 and c2 are also referred to as projects. I guess it will be solved is if I remove them from Eclipse and run mvn eclipse:eclipse again and import them again.

Best regards!
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester