Maven2 + Eclipse 3.5 web Project Errors - eclipse

I'm using Maven 2.2 to build Simple Web Project and Integrate it to Eclipse:
I'm doing it the following way:
1) Going to my workspace directory using command line:
2) Create Project using the following command:
mvn archetype:generate -DgroupId=com.vanilla.test -DartifactId=myTest -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
3) Convert this project to Eclipse project:
cd myTest
mvn eclipse:eclipse -Dwtpversion=R7
When I import then project to Eclispe I have red 'x' on the project name. Although, I tried to Clean project, to refresh it or run index.jsp, I can't fix it.
No any other problems with the project.
Why does it happen?

Perhaps you should configure the workspace before converting to Eclipse project.
mvn eclipse:configure-workspace -Declipse.workspace=<path-of-your-workspace>

Related

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.

How to build maven spark project (Scala), then import and config eclipse

I have cloned this project: https://github.com/sryza/aas
and built successful with maven ( pom.xml)
I then import to Eclipse oxygen ( scala IDE plug in), open and run the file "main.scala", and had an error: not found the main class though I had tried to run as configuration with scala nature. Which step i missed?
In general how can i config eclipse to switch with Java, Scala, and python(install PyDev)
Thanks for your help
You can try the following:
1 When you clone the project use: mvn eclipse:eclipse so you can import it in eclipse.
2 Run mvn clean install to see if the project is building
Witch Eclipse IDE for Java EE Developers you should be able to run it

Failed to create Maven Project in eclipse

I added maven plugin in my eclipse .. but still can't create Maven project (doesn't exist in new project ) and i can't find it also in window -> preferences .. can any one tell me what's wrong please !?
May be Maven Integration (m2e) plugin not installed properly(check the eclipse version & try to install suitable plugin).
Alternately you could create maven project via command,
For core java project,
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
For Webapplication,
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
Kindly refer the below link:
http://www.mkyong.com/tutorials/maven-tutorials/

Maven works but eclipse error

I created a maven project from the command-line interface. Configured the dependencies with my other maven projects. Now when I run my project, it works without any problem using the following maven command:
$ mvn clean
$ mvn install
$ mvn exec:java
Hello world!
Then, I use the following maven command to have my eclipse project files.
$ mvn eclipse:eclipse
I go and open my project using Eclipse Kepler, however as you can see there is a exclamation point on my project and it does not run from eclipse.
The problem is I do not know how to find the error on eclipse..

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.