-1

I've creates new Spring MVC project. By default Intellij added pom.xml and so on. I have no changes in a default created project , but get an error when clean and install a maven. Please help me to solve this problem.

enter image description here

Maria
  • 233
  • 3
  • 13

1 Answers1

1

Your POM has non-standard characters (whitespace) in your <artifactId>. Change it from:

<groupId>com.springapp</groupId>
<artifactId>Calc Spring MVC</artifactId>
<version>1.0-SNAPSHOT</version>

to:

<groupId>com.springapp</groupId>
<artifactId>calc-spring-mvn</artifactId>
<version>1.0-SNAPSHOT</version>

One of the reasons for this constraint is that Maven will potentially resolve dependencies using these coordinates through a URL, where for instance a space character will translate into %20 which obviously can complicate things.

The official guide does provide some guidance for naming conventions, but is a bit unclear as to what "strange symbols" are. My advice is: use lowercase and hyphens. This is what most people do.

Guide to naming conventions on groupId, artifactId and version

Daniel
  • 4,033
  • 4
  • 24
  • 33
  • A better answer would explain _why_ this is a disallowed character. – Tunaki Mar 06 '16 at 18:30
  • Fair enough. I have updated the answer with more information. On the other hand, for the answer to be accurate, the question should really have been phrased "Maven artifactId does not match a valid id pattern". – Daniel Mar 06 '16 at 19:25
  • That's a valid point. In the linked question, I tracked down the part of the code making the validation. – Tunaki Mar 06 '16 at 19:26
  • Ah, excellent! Yes, your original answer to the question you linked to really hit the head on the nail, especially with the regex. Great work! – Daniel Mar 06 '16 at 19:30