Maven Eclipse downloading jar from central repository - eclipse

When I run mvn eclipse:eclipse against my project the dependencies are downloading from maven central repository http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom. In the settings.xml file I'm pointing to the local repository c:\maven\repo to download the jar files from.But, When I do the mvn clean install the jars are downloading from the local repository.
Not sure why the with mvn eclipse:eclipse it's always pointing to Maven central repository. Any idea, how I can get the mvn eclipse:eclipse point to local repository and download it from there.

Related

I cloned drools repo, tried to mvn install, but it give an error of unresolved parent POM

I am using Ubuntu 18. I cloned drools repo to my computer, tried mvn clean install, but it gives me an error:
[ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for
org.drools:drools:[unknown-version]: Could not find artifact
org.kie:kie-parent:pom:7.21.0-SNAPSHOT in nexus
(http://nexus-cls.ptc.com/artifactory/public) and
'parent.relativePath' points at wrong local POM # line 6, column 11
When I import drools into eclipse, all poms give the same error
Try following this instructions to clone the repositories
https://github.com/kiegroup/droolsjbpm-build-bootstrap
Anyway a
git clone git#github.com:kiegroup/droolsjbpm-build-bootstrap.git
and
mvn clean install -DskipTests
should suffice. Have fun!

Eclipse can't find a class on my classpath

The project is a maven project.
run as maven install works
mvn install works
I have tried mvn eclipse:eclipse to update project, I can see the jar file in my properties order and export
I have closed and reopened the project
I have deleted and re added the project
I have done a refresh
I have done a maven update project
I have cleaned the project
maven disable maven nature and then configure convert to maven project
It builds just fine from:
The command line:
mvn install
In eclipse run as maven install
It works in intellij idea
For the love of all that is holy...
There was a class of the same name in this project with all lines commented out.
Deleting that source file fixed the problem.

Referenced classpath entry for JAR in local maven repository missing when importing nutch

I am trying to import nutch 1.4 into Eclipse. I cloned git repository and then build it using Maven. Then, I imported it in Eclipse as Maven project, but I'm getting the following error:
The archive: /home/devang/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar which is referenced by the classpath, does not exist.
I've seen this behaviour when I had a project already imported in Eclipse, but then deleted the local Maven repository.
To solve this, make m2eclipse re-download the project's dependencies:
Right-click on the project and select Maven > Update Project...
Select Force Update of Snapshots/Releases and hit OK

Run maven:install will copy more jars to WEB-INF/lib than i expect

Eclipse Indigo; m2e 1.1.0; Maven integration for WTP 0.15.3; Maven 3.0.4
My web project has some dependency projects in the same workspace. All projects are installed. When i run maven install, except to see all dependencies in WEB-INF/lib.
When i run maven install plugin or maven war plugin, the WEB-INF/lib will be filled with dependencies, but they are a lot more than i expected, from the "dependency Hierarchy" or "Effective POM" view of the POM file, or from Maven dependencies in classpath view, i can not find the dependencies.
Run Maven->update projects does not help.
So where these dependencies come from or where should i start to debug?
EDIT
Previously my project has a large dependency tree(100+ jars), some of them are not needed, so i decided to remove them. My project depends on a common project, which has some not needed dependencies, i remove them from POM dependencies and run maven install for the whole projects dependency tree, success. then i run maven install on my project, it should not include the jars i removed from the common project, but, unfortunately they are there in WEB-INF/lib.
If you want to know where your dependencies are coming from, run:
mvn dependency:tree
from the command line. This shows how transitive dependencies are pulled in from your declared dependencies.
You can also run:
mvn dependency:analyze
to see if you can remove any unused dependencies to lessen the number of JARs packaged.
Problem solved, I delete the whole project and import from remote, run maven-install, it worked. Still have no idea why it not work before even after i run "maven clean install" on all dependency projects.

SNAPSHOT Artifacts not visible in eclipse after mvn install

from proj-a folder: run mvn install proj-a
from proj-b folder: (proj-b depends on proj-a) run mvn clean eclipse:clean eclipse:eclipse
refresh proj-b in eclipse.
jars that proj-a depends on are in the proj-b classpath, but proj-a-0.0.1-SNAPSHOT.jar is missing. proj-a-0.0.1-SNAPSHOT.jar is in the local repository.
run mvn deploy for proj-a
delete proj-a folder from local repository
run mvn eclipse:eclipse from proj-b folder - all jars are visible.
what can cause this problem? all artifacts should be available right after install operation. mvn does not complains about nothing....
thanks.
For me handling maven projects in eclipse becomes easier using m2eclipse. After you have installed the plugin, right click on your project > Maven > Enable Dependency Management so that it becomes a maven eclipse project. Then, given you have run your mvn install and you can see your SNAPSHOT jar in your local repository, right click on your maven project > Maven > Update Snapshots or in general Maven > Update Dependencies.