My new job requires to work with eclipse and the IDE works well so far. But there's one thing I couldn't manage / understand. I am used to Visual Studio and there's a solution file containing some projects and the IDE enables me to work with them.
In eclipse I have my workspace and can add my projects. My projects may have some dependencies to each other and so on. Works great. But how to manage more than one projects ( or in the VS term solution)?
Do I have to use different workspaces? Ok, I can do that, but what if there's one project I want to use in two or more projects.
It's a beginner question, but an important one I think. So it should be interesting for other .NET users as well. Thanks a lot for helping.
Björn
In eclipse you can add as many as projects you need based on your project dependencies.So now wen we are talking about the dependencies whether do you want add the .jar file or project.Both the ways will help you to get rid of compile errors in your project.
1.Add muiltiple projects just by importing your project
File -> Import -> Select type of your project (Suggested options or i
use : Existing projects into workspace ,Existing maven projects)
2.You can link different projects by
Right click the project in eclipse -> BuildPath ->Configure Build Path
-> Projects -> Add --> (locate your projects in the workspace).
3.You can package your existing project as .war or .jar and add them into your project by
Right click the project in eclipse -> BuildPath ->Configure Build Path
-> Select libraries --> Add external jars (Then locate your jar's and add them).
Basically 2nd option is used in the debugging purpose,while the 3rd is bit tough to debug.
All these projects can be navigated using Project explorer window.
Whenever checking out Maven project from svn server in Eclipse, it creates a new folder like maven.xxxxxxxxxxxx under the target workspace. After specific time, it disconnected from SVN server.
My question is when the new checkout process is started again:-
Can the next checking-out process merge to one of the existing folder maven.xxxxxxxxxxxx?
Any input would be appreciated!!
No, not directly. This happens if something stops the import step. While I can not tell you wat exactly went wrong in your case, I can tell you how to solve it:
Rename the maven.xxxxxfolder in your workspace to the real project name.
The select File -> Import... -> Existing Maven Project and choose the project folder. The project will appear in your workspace as maven project.
Depending on your eclipse configuration and plugins environment, you might also need to right-click on your new project and select Team -> Share... -> SVN (if there is a long list of options under Team, it is already correctly identifed as SVN project).
Update
If your maven.xxxx folder is empty, than you seem to have connection problems. Split the checkout and the import part:
Switch to the "SVN Repository Exploring" perspective, create the repository (if not already there). Can you browse the repository? If not, you have a connection problem (proxy?).
Right click your SVN project and select -> Checkout...
Select Check out as project in the workspace
This checks out the project as simple resource project
now back in the java perspective you can either delete the project and do an "Import existing Maven Project" or convert the project to a maven project using right-click -> Configure -> Convert to Maven project (exact command may vary with your m2e version).
If everything elese fails, try to checkout your project using TortoiseSVN (on Windows) or the commandline and doing "import -> existing maven project" afterwards.
i have a project which is using several components to perform the functionality.All the components are managed by maven dependency control.now i want to change the code of one of the component just to enhance the functionality.That component is visible to me in eclipse project explorer i can access the files present in that component.But when i change the code in component,that change is not accessible to main project which is using that component as dependency.i have tried maven:clean , update dependencies but nothing works.i am just new to maven so i am sure i am missing something.
any help is really appreciated.Thanks
When using maven with eclipse, dependencies can be used either directly as jar (as they were downloaded from the repositories) or, if the dependency is also defined in a project open in the same workspace, eclipse should use this project instead of the original jar.
You should check :
that "disable workspace resolution" is not checked (when your right-click on your project in the project explorer, in the "maven" sub-menu).
that in your project properties, in the "Java Build Path"( "Librairies" tab ) eclipse displays your dependency as a project and not as a jar from the local maven repository.
Also be careful to rename the component (and to publish it somewhere or to include the modified code in your project) to make sure that another developer building the project use the same modified dependecy and not the original one.
After you updated pom file with dependency, have you tried maven install ?
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.