I'm learning SpringMVC framework and checked out a copy of their code:
https://src.springframework.org/svn/spring-samples/mvc-basic/trunk/
I can do maven build, install and everything. But on Eclipse, run on server option never appeared. I have tomcat server up and running, also got plugin for eclipse. Why run on server option is missing? This is a Ubuntu machine.
When I tried the exact same thing on my Windows machine, everything was fine. It has the same version of eclipse and all sorts of plugins installed as the Ubuntu machine. I was able to launch it from Eclipse "run on server" option there.
Can someone help me to figure out why? Thanks.
Did you create a Web Project? If you right click on the project and go to Properties > Project Facets is Dynamic Web Module selected?
I had a similar issue. The Maven projects have different structure than "Dynamic Web Projects". Eclipse knows only how to deploy the Dynamic Web Projects (project structure used by Web Tools Platform).
In order to solve this and tell Eclipse how to deploy a "maven style" projects, you have to install the M2E Eclipse WTP plugin (I suppose you are already using the m2e plugin).
To install:
Preferences->Maven->Discovery->Open Catalog and choose the WTP plugin.
After reinstalling, you will be able to "run on server" those projects which are maven web projects.
Hope that helps,
The topic is old but today I was facing the same problem, I imported a Maven project and when I tried adding to Tomcat it did not show the project. What worked for me:
Properties >> Project Facets and then check the options: Dynamic Web Module + Java then click in apply.
I hope it helps :)
For me worked:
Right click on project > Properties > Project Faces > change Configuration from "custom" to "Default configuration for Apache Tomcat v7.0" > OK and then Run on Server option has appeared.
Follow the below steps:
1) Right click on your maven project.
2) Select Maven
3) Update Project
4) check the
update project configuration from pom.xml
refresh workspace resources from local filesystem.
clean projects.
That's it.
Do you see any servers in server view in eclipse? Probably simply you have not created any server instances.
Perhaps you lost some configuration, check jar dependencies in properties -> Deployment Assembly. If you miss something, try to add dependencies again.
in my case, fixing this, Run on Server appear again.
There is only 1 thing that fixed this for me. In the pom.xml, add the tag:
<packaging>war</packaging>
Then after saving that, when you right click on the project you should now see the "Run As... Run on Server" option showing up.
I had to do the following
remove /WebContent from Deployment Assembly and add /src/main/webapp
Add Library (Properties->Java Build Path->Libraries), Server Runtimes
This got me working, in addition to #alanbartczak answer.
we have to install the M2E Eclipse WTP plugin
To install: Preferences->Maven->Discovery->Open Catalog and choose the WTP plugin.
And restart eclipse
I was facing similar issue when i created a new workspace in STS.
Project => right click => Maven option was also missing.
I tried this below steps and it worked.. hope it helps someone else.
Project => right click => configure => convert to maven project and then the option to run on server appeared.
Right click on the project, go to "Run as", select "Run configurations" and create a run configuration.
Related
I use spring tools suite STS 3.9.1 and I have import a project gradle of my old computer to new computer.
When I use click right context menu 'Refresh Gradle Project' it build sucessfully but i don't see a external library in my treeview project and I can't publish to tomcat and start tomcat.
What's the problem ?
Thanks a lot
maybe you can execute this command gradlew eclipse or ./gradlew eclipse and then export the project
In fact , for my mind , the solution is to launch the Build or Build Depends task, and in a file log, I have a problem of certificat SSL in my cacerts
so it's all good
Thanks for your help
I am trying to create a simple Maven project in Eclipse Luna. As this is my first maven project so I am starting with a simple one. I am trying to crate a simple web project using the webapp-j2ee14 archetype.
While creating I found that this archetype is not present in archetype list. So I tried with Add Archetype option and Provided the following archetype options.
<archetype>
<groupId>org.codehaus.mojo.archetypes</groupId>
<artifactId>webapp-j2ee14</artifactId>
<version>1.3</version>
<repository>http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/webapp-j2ee14/1.3/</repository>
</archetype>
The above code snippet is basically from archetype-catalog.xml file in .m2 directory in my system, but I actually entered them from eclipse UI.
Now, when I am clicking finish it's giving me the following error...
I tried with few other repo url after searching google but getting the same error. Where can I get the correct repo url for this archetype??
Thanks in advance...
Add Remote Archetype in your eclipse it will show you that option. Following are the steps:
File--->New---> Maven Project---->Next--->Click on tab Configure
Separate window will open... Maven-->Archetypes-->Click on Add Remote Catalog--> In Catalog File type "http://repo1.maven.org/maven2/archetype-catalog.xml" and click on Apply and then Ok
Now in new Maven Project select Remote Archetype from Catalog and you will find webapp-j2ee14 option there.
I got the same problem and i was creating a simple Web App. I created the MAVEN project first then i deleted it and again when i created it i got this error. So i changed the version of archetype. I was using 2.16 version of the archetype that i was adding to my MAVEN project, changed it to latest 2.26 and it worked for me.
You can check the latest version from http://repo1.maven.org/maven2/archetype-catalog.xml
I got this problem as I have deleted a previously created project from Eclipse.
Later, I deleted the .metadata file and the project from workspace. Then this problem was resolved.
I got same issue, I have solved by manually removing unused pom.xml file at the working workspace or root of workspace directory.
I think the work space has messed up of some reason. These steps below may help
Close eclipse
delete the .metadata directory
Restart the eclipse, pointing to same workspace and try the process to create new maven project
or if this approach didn't work
switch to a fresh new workspace and try the same process to create your maven project
This is worked for me!
After working whole day, finally I found the solution. I just went to Eclipse marketlace(help-Eclipse marketplace) and updated maven from there. Now it works wonders. Earlier I was unable to install TestNG plugin from Eclipse marketplace, but now after updating maven from there, Testng plugin successfully installed in my eclipse luna.
I was trying to create a maven archetype quickstart and faced this issue, I have never created any maven project before so for those below is the steps you need to follow -
Go to to Run -> Run As -> Maven Install
In the project explorer right click on pom.xml file -> Maven -> Update project.
This will for sure resolve the issue.
Eclipse version I am using : 2021-09 (4.21.0)
I am trying to import maven project into eclipse 4.2 version.Its not importing the project properly. Its giving me error "Source folder is not a Java project" while I am trying to create a new call in it. Even ctrl+mouse click is also not working. I don't understand the problem. Even when I right click on project and select build path it shows me no action available. Anyone face the same issue
In the maven project directory try
mvn eclipse:eclipse
that may do the trick.
I ran into the same issue and fixed it by converting my project to faceted form.
Right click your project > Properties > Project Facets > Convert to Faceted Form, and select Java.
I had the same problem... But you just need to update "source Folder" to correct source "src/main/java" from whatever mentioned in the pop up:
[]
Either turn your project into Eclipse project, using mvn eclipse:eclipse, or install Maven Integration for Eclipse plugins, like m2eclipse, and import project as a Maven project.
I got the same error in a slightly different context (Indigo with m2eclipse):
I imported a multi-module (1 jar module and 1 war module) maven project into Eclipse. Everything worked fine (clean, install OK) until I tried to add a new class to one of the modules and got the "Source Folder is not a Java project" error.
I solved this by opening the properties on the parent project and selecting the following Project Facets:
Java
Dynamic Web Module
This solved the problem. My guess is that, because the parent project for a multi-module project has pom packaging (<packaging>pom</packaging>), Eclipse doesn't know what kind of projects the parent project encloses (i.e. if the packaging were jar, it would know that it's a java project; if the packaging were war, it would know that it's a static or dynamic web module, etc.)
This is just my guess, but the fix worked for me, and it makes sense.
for those who already see java selected, uncheck and check it again.
select apply to override the existing setttings. finally it works !
Right click your project > Properties > Project Facets > Convert to Faceted Form, and select Java
Right click your project > Maven > Update Project
This step will add your project so the issue resolves easily.
mvn eclipse:eclipse
will resolve this problem. convert to maven project.
I had this error because I tried to create a new Project by doing "Ctrl+N", typing "Project" on the Wizard's input label and then just pushing "Enter" until it was created.
I solved this by typing "Java Project" instead of just "Project".
You can also create a JAVA PROJECT by going to File > New > Java Project.
open cmd and run the following command in the folder of your project-
mvn eclipse:eclipse
This did the trick for me
If you are having maven project and you are getting this error. You can follow below steps.
Right click on the project and select properties.
Then click on Project Natures
In the dialogue box, click on Add and in the warning click on OK.
Filter java in the popup box and click on OK.
Click on apply and close.
It will add java nature to your maven project and you will not get this error anymore.
Right click your project > Properties > Project Facets > Convert to Faceted Form, select Java, and apply&close
I am in Eclipse Indigo and I have installed m2eclipse plugin. I saw in Eclipse Helios there is an option Maven in the right click menu, when I clicked on a Project, but this option is not present now.
I have installed Maven from both of the marketplace and also from adding site in Install new software option in Eclipse(Help->Install New Software).
What I am doing wrong.
This question was asked before in SO, but I tried the solution provided there.
Is this option is really not present? What I want is to enable Maven Dependency Management of a Dynamic Web Project of Eclipse.
You have to do a right click on the project, then choose Configure → Convert to Maven project
Right Click on the Project --> Configure --> Convert to Maven Project.
It will show Maven Related Options.
One way is to import the project as Maven project.
If you are trying to install in Eclipse older versions, use YOXOS Marketplace - by EclipseSource. Search for "Maven" in marketplace. You will get Maven Integration for Eclipse provided by Sonatype. Use that to install.
After installing m2eclipse plugin, go to Window -> Preferences. Check "Maven" is enlisted at the left panel list
this happened to me because I imported a parent folder as a project. so all my projects where sub directories of this parent folder and not a project them selves. after deleting them (only) from the workspace and re importing them as separate projects, maven worked fine.
I have a that uses maven... and I want to put it in my working environment with eclipse(Galileo)... the project is in a svn server, and I can create check out the project and everything looks OK. I even can run the unit test and everything is working there.
However, now that everything is there I wanted to work in the code, and oh surprise there are no packages in my project... I mean all the source code is in the src folder and browsing through it i can see all my files, ut if I open the files from there, the files are opened as text files with no coloring, but worst no help at all about errors in compilation.
I don't know what im I doing wrong now, because I had the same project in other machine and it was working well.
So here is what I did, please let me know if you notice if I did something wrong, miss any steps or anything that can help me:
In the SVN Repository (Using subclipse 1.6.10) I added my SVN Repository
Browsed to the folder where I have the pom file
Right Click> Check out as a Maven project...(Using m2eclipse 0.10.020100209)
Used the default options and finish.
The projects were created with no problem. I said projects because this maven project has modules, and each module became a project in eclipse.
Back in the java perspective, Right click in the project, Run as > maven test(Using JWebUnitTest, because I am testing a servlet)
BUILD SUCCESS!!
But as I said there is not packages so I can't really develop in this environment.
Any help??
Thanks!
When performing a svn checkout as maven project, m2eclipse writes what it does in a console window, accessible using the "console" panel, where there is a drop-down list of all available consoles. What does this console tells ?
Besides, if you can perform a maven test, you can also, in the maven menu (of your contextual menu) do a "update project configuration" which should do the same thing and configure eclipse for your project.
As a last test, is there a maven icon over your project ?
Have you tested your setup on command line with Maven ? Does a mvn package work without errors ? The location for the sources in Maven is src/main/java + Package name. Have you opened the project as a Maven project?
Thanks for your help, however I noticed that eclipse itself was behaving weird when I try to create a package there and I didn't have the option.
So I found out that for some reason that eclipse installation wasn't giving me any of the Java basic options.
So I download a new eclipse installation.. and I repeat the whole process and now is working...
No clue what was the problem with this eclipse because I was using it for other projects and I don't know when I lost the basic functionalities!
Thanks anyway!