sof
sof

Reputation: 9649

Maven and M2Eclipse Co-existing

Firstly I've installed maven 3 to /path/to/maven and configured /path/to/maven/conf/setting.xml below,

<localRepository>/path/to/repository</localRepository>

then installed m2eclipse on Eclipse 3.7.2 for Java EE and configured it below,

preferences->maven->
 installation->"/path/to/maven"
 userSettings->"/path/to/maven/conf/setting.xml"
 localRepository->"/path/to/repository"

On completion of building the index by m2eclipse, a duplicate .cache directory has been generated under both /path/to/repository and /path/to/home/.m2/repository below,

.cache/
└── [4.0K]  m2e
    └── [4.0K]  1.2.0
        └── ....
            ├── [ 64M]  nexus-maven-repository-index.gz
            └── [1.1K]  nexus-maven-repository-index.properties

Upvotes: 0

Views: 217

Answers (3)

Fred Bricon
Fred Bricon

Reputation: 5579

Having duplicate repositories could be caused by bad formed settings.xml. e.g. if it contains errors (like some unclosed tags), m2eclipse will ignore it and generate a new in-memory settings model, using the default values.

In command line, check that mvn help:effective-settings executes properly.

The cached index is only used by m2e, so it can't be corrupted when using both m2e and maven CLI.

Upvotes: 0

Steven Schlansker
Steven Schlansker

Reputation: 38526

Sachin is right - you're probably misconfigured. That said, I would consider dropping a symlink in my home directory instead of configuring a different path. That way there is no need to ensure that any tool is configured correctly, as the default location just points somewhere else.

Upvotes: 0

appbootup
appbootup

Reputation: 9537

It is not common to have two repositories. Both m2e and cli should point to same repo. Verify your eclipse settings for maven.

Upvotes: 2

Related Questions