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>

What is the difference between “Maven Install” and “Maven Build” with M2Eclipse?

First of all, build is not a phase in the standard Maven lifecycles, whereas install is one. mvn install will invoke all the phases up to the phase install, which generally consists of compiling the source code, packaging the project and installing it in the local repository. To be clear, we’re talking about what M2Eclipse … Read more

Should renaming a project in Eclipse also rename project folder on file system?

It appears that renaming a project will only rename the underlying filesystem directory if the project was created with the “Use Default Location” checkbox selected (meaning the project is created in the workspace directory). If you create a project and specify a custom location outside the workspace, renaming that project in Eclipse does not rename … Read more

maven plugins stored where

Where are maven plugins stored? in the local repository as well? Yes. Plugins are downloaded from a remote repository and stored in the local repository. The exact final location will thus depend on the groupId of the plugins (the core plugins end up in ~/.m2/repository/org/apache/maven/plugins where ~/ stands for your home directory for example in … Read more

Maven 3 Artifact problem

The error you are seeing is probably because you dont have your JAVA_HOME path set up correctly. Are you seeing something like C:\{directories to jre}\..\lib\tools.jar? You can have eclipse start up using your built in JDK by altering the eclipse.ini and adding something like -vm C:\{directories to JDK}\bin\javaw.exe What I have learned is that eclipse … Read more

Hide unit tests from Call Hierarchy

In the Call Hierarchy view, click the white downwards arrow icon. Select “Filters…”. Check “Filter Test Code”. Click the refresh button (or press F5). The test classes and methods should not be visible anymore. The “Filter Test Code” checkbox was added in Eclipse Photon. In earlier versions, you can select the “Name filter patterns” checkbox … Read more

Maven plugin in Eclipse – Settings.xml file is missing

The settings file is never created automatically, you must create it yourself, whether you use embedded or “real” maven. Create it at the following location <your home folder>/.m2/settings.xml e.g. C:\Users\YourUserName\.m2\settings.xml on Windows or /home/YourUserName/.m2/settings.xml on Linux Here’s an empty skeleton you can use: <settings xmlns=”http://maven.apache.org/SETTINGS/1.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd”> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <servers/> <mirrors/> … Read more

m2eclipse not finding maven dependencies, artifacts not found

I had this issue for dependencies that were created in other projects. Downloaded thirdparty dependencies showed up fine in the build path, but not a library that I had created. SOLUTION: In the project that is not building correctly, right-click on the project and choose Properties, and then Maven. Uncheck the box labeled “Resolve dependencies … 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

tech