• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to repair my maven project after adding dependency  RSS feed

 
Steve Holdorf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to Spring MVC programming using maven with the mars eclipse IDE. I had a Spring MVC project working fine. What I wanted to do was add a login security page to the application an now I have a big problem. What I did was cut a list of maven dependencies from a tutorial website and paste them into the pom.xml file and now I can't build the project. I even removed the pasted dependencies and it still won't build. It appears that the application thinks there is still a mismatch. Below is what I copied into the pom.xml:

<dependency>
<groupid>org.springframework.security</groupid>
<artifactid>spring-security-core</artifactid>
<version>${org.springframework.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupid>org.springframework.security</groupid>
<artifactid>spring-security-web</artifactid>
<version>${org.springframework.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupid>org.springframework.security</groupid>
<artifactid>spring-security-config</artifactid>
<version>${org.springframework.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupid>org.springframework.security</groupid>
<artifactid>spring-security-taglibs</artifactid>
<version>${org.springframework.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

I hope someone can help.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,
What error do you get when removing the dependencies? Have you tried right click > Maven > update project? That syncs Eclipse with the current state of the POM.
 
Steve Holdorf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that I really broke something and I don't know how to fix it. I am getting several of these error messages and am pasting one below:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'groupid'. One of '{"http://maven.apache.org/POM/4.0.0":groupId, "http://maven.apache.org/POM/4.0.0":artifactId, "http://maven.apache.org/POM/4.0.0":version, "http://maven.apache.org/POM/4.0.0":type, "http://maven.apache.org/POM/4.0.0":classifier, "http://maven.apache.org/POM/4.0.0":scope, "http://maven.apache.org/POM/4.0.0":systemPath, "http://maven.apache.org/POM/4.0.0":exclusions, "http://maven.apache.org/POM/4.0.0":optional}' is expected.


Now I just did a maven->update project and in the Dependency Hierarchy tab it has in large font letters "Dependency Hierarchy [test]" and there is a message indicating "Resolving dependencies" but it has been running for about 30 minutes. Is that normal or did a process just time out and leave me stuck?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not normal. I think the the thing to do is:

1) Restart Eclipse in case something got stuck
2) Create a new project without dependencies to make sure Maven still works.
3) Start adding dependencies to that project to see when the problem shows up.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML is case sensitive. You're using groupid but it should be groupId. Likewise for artifactid vs artifactId. The error actually tells you this, although the namespaces make it a bit cryptic. If you remove those, you get the following:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'groupid'. One of '{groupId, artifactId, version, type, classifier, scope, systemPath, exclusions, ptional}' is expected.

I'm not sure if that last ptional is a bug in Maven or a copy-paste error, because it should be optional.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!