Metadata
Metadata

Reputation: 2083

Error while create Scala-Maven project on IntelliJ

I am trying to create a Scala-Maven project on IntelliJ. I had downloaded the plugin Scala. When I try to create a project from IntelliJ's file menu like below:

enter image description here

enter image description here

enter image description here

enter image description here

Once I click on NEXT and FINISH, I see the Idea tries to build the project and fails with this message:

"C:\Program Files\Java\jdk1.8.0_151\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\Bobby\AppData\Local\Temp\archetypetmp "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.4\plugins\maven\lib\maven3\bin\m2.conf" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.1.4 -s C:\Users\Bobby\.m2\settings.xml -Dmaven.repo.local=C:\Users\Bobby\.m2\repository -DinteractiveMode=false -DgroupId=com.sample.programs -DartifactId=Abcd -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.scala-tools.archetypes -DarchetypeArtifactId=scala-archetype-simple -DarchetypeVersion=1.2 -DarchetypeRepository=http://scala-tools.org/repo-releases org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate
[ERROR] Error executing Maven.
[ERROR] 1 problem was encountered while building the effective settings
[FATAL] Non-parseable settings C:\Users\Bobby\.m2\settings.xml: only whitespace content allowed before start tag and not x (position: START_DOCUMENT seen x... @1:1)  @ C:\Users\Bobby\.m2\settings.xml, line 1, column 1

[ERROR] Maven execution terminated abnormally (exit code 1)

I checked the maven folder in my desktop and these are the sub folders inside .m2/repository: enter image description here

Could anyone let me know what is the problem here and what should I do to make this work ?

Upvotes: 0

Views: 635

Answers (1)

Julien Gaye
Julien Gaye

Reputation: 36

I tried to follow your exact steps but didn't get the same error. I'm using IntelliJ IDEA Community 2016.2 .

From the error message you received, it looks like you might have a corrupted .m2\settings.xml. I noticed that this file doesn't exist by default on my computer. I tried to create one with only the 'x' character, and that causes an error on my maven build (but not exactly the same as yours).

Try to check that file, and make sure it's content is xml formatted, or erase it completely (if you are sure it's safe). There is a UI way to see that document in IntelliJ:
1. Open the Maven Project tab
2. Right click on your project title
Maven Project Tab
3. Select " Open 'settings.xml' "
opened settings.xml
4. The setting file content is displayed in your IDE and can be modified

Hope that helps

Upvotes: 2

Related Questions