Why is maven setting the wrong place?

I am trying to run mvn install, it compiles fine, but for some reason maven is trying to install in this place:

[INFO] Installing /home/username/workspace/projectname/pom.xml to 
/home/username/workspace/projectname/?/.m2/repository/artifactname/artifact.pom

Please note that the location is? in that. This place really should be the /.m2 home directory. Any idea what makes it set the wrong location?

Edit: Running mvn -help: effective settings:

  <localRepository xmlns="http://maven.apache.org/SETTINGS/1.0.0">
      /home/username/workspace/projectname/?/.m2/repository
  </localRepository>

I wonder if I ran mvn -help: efficient settings from another directory, say: / tmp, it gives:

  <localRepository xmlns="http://maven.apache.org/SETTINGS/1.0.0">
      /tmp/?/.m2/repository
  </localRepository>
+3
source share
3 answers

Run the following goals in the project:

mvn help:effective-settings

And check the value localRepository(and update the question with the value).

: , . ...

localRepository ${user.home}/.m2/repository. , :

  • settings.xml Maven: $M2_HOME/conf/settings.xml
  • settings.xml install: ${user.home}/.m2/settings.xml

, ${user.home} ( ):

mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=user.home

, %USERPROFILE%, Windows.

2: , ${user.home} Linux, Java: System.getProperty( "user.home" ) "?" - : 64- JDK 64- .

JDK? ? ( , , JDK, 32- JDK 64- ).

3: : 6972329 ( JDK , ).

+9

localRepository settings.xml.

0

See your environment variables! Make sure that you do not set the variable "MAVEN_OPTS", as it will override all other settings.

I cut and pasted that from another machine, without noticing this, it was: "-Dmaven.repo.local = XXXX". (blush)

0
source

Source: https://habr.com/ru/post/1761963/


All Articles