Codey McCodeface
Codey McCodeface

Reputation: 3028

m2e and Maven profiles

I have setup a Maven profile following the advice on the Maven Site

<activeProfiles>
     <activeProfile>awayFromArchiva</activeProfile>
</activeProfiles>

Now I can use this profile to stop errors during the build when Maven tries to download from an Archiva repository that is not available. I can compile on the command line successfully. Using the command line I get

[INFO] Unable to find resource 'xyz' in repository central (http://repo1.maven.org/maven2)

during the successful build. A similar message is given in Eclipse but thrown as an error.

The profile does work as expected since the Archiva instance specified in my settings.xml for a different profile is ignored but the same goals produce very different results.

How can you ensure that m2e behaves the same as mvn on the command line?

Upvotes: 1

Views: 3107

Answers (1)

Sajan Chandran
Sajan Chandran

Reputation: 11487

In eclipse go to Windows -> Preferences -> Maven -> User Settings and change your user settings to point to your local settings.xml which your command prompt maven use.

Eclipse m2e uses embedded maven installation, you can point your eclipse to use your local maven installation.

Hope it helps.

Upvotes: 1

Related Questions