I can run my first project created correctly (springboot, eclipse), but when I run any of the other projects, the following errors are shown:
The problem is occurs when I create projects using Spring Boot v2.3.4, but when I use version 2.1.17, projects are built correctly --- obviously it must be a compatibility issue.
Soln 1.
You can try updating maven project.
Right Click the project -> Maven -> Update Project.
Then do maven clean install
OR
Soln 2.
From the image it can be seen that it says "it cannot be read or is not a valid zip file". So for all such jar file go to the respective location in .m2 and delete such jar files. Then
Right Click the project -> Maven -> Update Project.
Then do maven clean install
I cloned one of the open source git repositories and was trying to import it as maven project in eclipse. After I imported everything as a maven project, whole package is getting messed up. See the below error:
How can I fix this issue so that I can build it on my local box? I cloned the same git repository locally on my desktop.
I am using eclipse version:
Eclipse IDE for Java Developers
Version: Luna Service Release 1a (4.4.1)
Build id: 20150109-0600
Steps I have tried already:
I have already tried maven->update project.
I have also tried removing and adding it again.
I tried mvn clean install both on command line and eclipse, they are successful as well.
Can anyone help me with this? If needed, you can also clone it and try importing it to see whether it works for you or not.
The root of your problem is that the build section of the pom.xml for that project specifies:
<sourceDirectory>./src</sourceDirectory>
Eclipse uses the sourceDirectory tag to tell it where the root of the main sources are. If you change that to ./src/main/java, then right-click on the project > Maven > Update Project... and click Ok (I had to do this twice) it will fix the Eclipse classpath so Eclipse can build the project. You can then revert the pom back to the head revision and so long as you don't run Update Project again it should continue to build.
I'm unclear on why that project specifies a non-standard source directory but uses the standard Maven layout, but this should at least get you into a working state within Eclipse.
I created the maven-spring project using the m2e plugin of eclipse. The project is working fine. I want to do a Maven build in Eclipse the project without using any commands in command prompt i.e. using the eclipse IDE only. But I am not able to find the option for Maven build from Eclipse IDE.
Below are the options I am getting when I right click on my project:
Kindly advise.
you can follow this link, right click maven project -> run as -> maven build..
http://www.tutorialspoint.com/maven/maven_eclispe_ide.htm
Right-click on pom.xml, then go to the "Run As" menu (not the "maven" menu). The various plug-in goals (and lifecycle targets) are documented here.
I checked out the existing project source code from SVN to a folder in my system.
Then I opened eclipse. Import Project-> Existing Maven Project.
It imported without issues. However, Project Explorer shows it as just folders instead of packages. (Like when we create a package and then add classes to it, it shows a different icon for package root). I opened Navigator and Package Explorer as well. But they are showing them as folders as well.
I tried:
mvn eclipse:clean
mvn eclipse:eclipse
on the root of the project. But it did not help.
Can anyone help on this one?
My folder structure:
ecs->
ecs-ejb->
src/java/main/com/xxx
pom.xml
ecs->ear->
src/java/main/com/xxx
pom.xml
pom.xml
Try to:
Right click the project->Configure->Convert to Maven Project
---- Edit ----
If this doesnt work, it is likely that someone checked in their environment files into your SVN. If they checked in:
.project
.classpath
.settings/
They could be conflicting with your environment (different settings/plugins/versions of eclipse...). Try dropping your project, deleting the folder/files, then remove these files from SVN, and repeat your initial process. All of these files/folders will get generated during the import to eclipse.
---- Edit 2 ----
Per your recent edit to the question, you have a multi-module project. If you only did this on the parent project, then there is no source folder. So you wouldn't see it. You should:
File->Import...
Choose Existing Maven Projects, Next
Set the Root Directory to ecs/ecs-ejb, Finish
Repeat for all other modules.
In eclipse, each module of a multi-module maven project needs its own eclipse project.
Right click the project->Configure->Convert to Faceted Form
This solution worked for me
Possibility is Module doesn't have .classpath.
Kindly right click on Module and Change Project fact as Java.
else
If you are using command Prompt.
1. mvn eclipse:clean
2. mvn eclipse:eclipse
else
Delete Project from Eclipse don't delete content from disk. remove .classpath and .project
Re-import as maven existing Project
Right Click->Maven->Update Project.
Above works perfectly fine for Eclipse Juno and solves the problem.
You just need to change the nature of the project.
For MAC->
-> Right click on project
-> Properties -> Check Project Natures
-> Then add or remove accordingly if you are having a maven project then add Maven, add Java
I had the same problem. I tried a lot of things that I read on internet but the only way that I found to solve my problem was exclude all of my workspace files (.metadata folder) and create another one.
After that, I imported a existing maven project and all my problems are gone.
I also faced a similar issue. I resolved it by downloading the correct apache maven plugins in the maven repository org / apache/ Maven/ plugins. IN my case, everything was working fine earlier and I had deleted .m2 repository completely. After that I started getting these issues with same iDE and newer IDE versions as well. The pom.xml showed error related to lifecycle mappings. On downloading the correct plugin, the workspace worked fine.
Delete the metadata folder. Checkout again but select "Checkout as a project configured using the New Project Wizard" instead of "Checkout as a project in the workspace".
Then a New Project wizard will open, type maven there and select "Checkout Maven Projects from SCM" preferably or "Maven Project". It should work. Remember this step should be performed for Maven Projects only. For normal Projects just select Java Project or whatever relevant type Eclipse project it is.
Check and make sure you have eclipse pointing at a Java JDK directory instead of a Java JRE directory.
I had just installed eclipse and only the JRE was in the settings. I added the JDK path, changed it to the default and clicked on Maven -> Update project. Then the packages appeared in Package Explorer.
The hint that helped me figure this out is that when I tried to use the refactor to rename a class, it wouldn't do it, complaining that it wasn't a JDK.
Instead of importing as Existing Maven Project, follow below steps
I assume that your folder has pom.xml, src/main and src/test.
Step 1: Right click > Create New > Java Project > Chose the project folder has pom.xml
Step 2: Right Click on Project > Configure > Convert to Maven project
I got it working using Proyect --> Properties --> Project Facets
In my case was a web project so I checked Java and Dynamic Web Module
Try right click on project, Maven->Update Project... (or similar, the link name changes depending on version)
This works for me when adding new folders, but I have not encountered the problem when importing a project.
Right click the project, then click Configure -> Convert to Maven Project. If the packages still display as ordinary folders, then right click on the folder one level up (the one that is supposed to be the source folder), then click Build Path -> Use as a source folder.
Here is my solution please close the Project Explorer at the left top and open again.
(or)
1). Right Click on your miscellaneous project and choose project Explorer if available.
Adding projects to working sets should help
try it ->
right click the project -> Maven -> Assign Working Sets... -> Add projects to working sets
I have a Java project in Eclipse which includes a couple of external jar files. These external jar files are being rebuilt through a different process (not Eclipse, Ant). Those changes are not being reflected on the Eclipse project even if I refresh the project. If I close the project and reopen, it works.
Any suggestions on how I could expedite the project without having to close and reopen? Thanks.
Try right click on the project and select refresh.
If that does not work, go to the Project menu, clean, and check your project.
In the package explorer view, you can select the jar and do right click and refresh.
Is not available in Eclipse Version: 3.6.1, Build id: M20100909-0800. I think that version's current. A reportable bug IMHO.
Restarting Eclipse works.
In the package explorer view, you can select the jar and do right click and refresh.
If the above answers did not work for you and this jar is on your build path. Do following steps :
1- remove the jar from the build path(right clicking the jar -> Build Path -> Remove from build path)
2- add the jar to the build path(right clicking the jar -> Build Path -> Add to build path)
This worked for me and is much easier than restarting Eclipse.
If refreshing the project, cleaning the project, refreshing referenced jar (F5) does not work, it might be Maven dependency still referencing old version. If your project uses Maven, remove this jar temporarily from Maven Dependencies list (you can update it later). It worked for me..
I think you should check if you open auto build project option.
Project 、Auto Build Project
Everytime I change the method code block , Eclipse would help me build the project to jar.