Maven and eclipse: a reliable way to add non-Maven or external jars to a project?

1) you can use system scope dependency <dependency> <groupId>test</groupId> <artifactId>x</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${basedir}/lib/x.jar</systemPath> </dependency> 2) you can copy your x.jar to local maven repository as repository/test/x/1.0/x-1.0.jar and add a dependency as <dependency> <groupId>test</groupId> <artifactId>x</artifactId> <version>1.0</version> </dependency>

Eclipse Maven Projects get rid of wb-resource warnings

This is what i did to get rid of such superfluous warning; Window->Preferences->Validation. Now here look for Project Structure Validation, uncheck both (Manual and Build) and the warning will not bother anymore. In my Gradle based Spring Boot project there are similar resource directories causing issue but not any more. Hope this will help others.

In Eclipse m2e, how to reference workspace project?

The correct way to do this is the following: Use the dependencies section in the POM file exclusively, don’t fiddle with the Eclipse project references. Right-click the project, then select Maven > Update Project Configuration to reset the project to the Maven default settings. This way, m2e has ownership of the dependencies. Make sure all … Read more

m2Eclipse plugin: What does ‘Resolve Workspace Artifacts’ do?

Assume you have two or more projects in your workspace e.g. project1, project2 and so on. If project1 is dependent on project2 and project3, you just need to define the dependency of project1 on project2 and project3. By enabling Resolve Workspace Artifacts, m2Eclipse will auto-build the SNAPSHOT JAR of project2 and project3 and add in … Read more

Eclipse JRE System Library [J2SE-1.5]

The problem is not with Eclipse, but with the projects you’re importing. m2e will set the project’s JRE to match the maven project. The POM specifies the JRE version, and this is defaulted to 1.5 if not present. You need this in the POM: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> … Read more

How to eliminate the “maven-enforcer-plugin (goal “enforce”) is ignored by m2e” warning by eclipse?

The eclipse maven plugin runs a projects pom.xml file in order figure out how the maven project is configured and translate the maven pom.xml configuration into an eclipse configuration. A pom.xml can reference an arbitrary number of maven plugins and each of those plugins has the potential to leak memory, or do things that are … Read more

Cleaning Maven m2e .cache directory

In contrast to the other answers, make sure to keep .m2/*.xml (your settings) and .m2/repository (not strictly necessary to keep, but Maven will have to download half the Internet again). Now, as for that .cache folder: if you open Eclipse, M2Eclipse will sometimes run a job akin to “Downloading repository indexes”. These indexes allow you … Read more

What is Eclipse doing when it says that it’s updating indexes?

This is a general step that happens when m2e/m2eclipse (Maven integration for Eclipse) is installed, whether projects are actively using it or not. This step can be disabled through the Eclipse preferences: Window / Preferences / Maven / “Download repository index updates on startup”. This option is on the main “Maven” preference page (not a … Read more