I'm using Spring Tool Suite 3.1 and I have some issues deploying a web application to tomcat.
When I hit "run on server" and the server starts it throws the famous:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
So I check the /wtpwebapps directory to find that the project is deployed, but inside the lib folder only a few libraries are present. I completely miss the rationale behind their selection. Of course the libraries related to spring aren't there. Can anyone help?
This is my org.eclipse.wst.common.commonent file, maybe it can be useful:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Checkup">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="context-root" value="Checkup"/>
<property name="java-output-path" value="/Checkup/build/classes"/>
</wb-module>
EDIT:
you can see the list of maven plugin embedded with STS installation (no customizations)
add maven dependencies to deployment assembly, by right clicking project - navigating to deployment assembly, and then adding the maven dependencies library.
after hours of pain it seems the problem is solved thanks to magics or something. The "mysterious" procedure that fixed the things is the following:
run your project on tomcat and get the error
clean tomcat rclick ---> clean (not clean working directory) while your project is still on the server
run the server again
the tricky part is cleaning tomcat when the web app is still deployed. I really don't know why it works. If you stop the server, remove the application, clean the server and redeploy the application again you get the error.
I won't dare to understand further, I accept the mystery.
NimChimpsky's answer is right solution for me. Only it's not very specific. The detailed steps is: right click project -> select "properties" -> search "Deployment Assembly" -> click "Add" button -> add "Maven Dependent"
Another way to fix this issue is by using the terminal (Linux or Mac) or the command prompt (Windows). Navigate to the folder of the project and use the following command:
mvn eclipse:eclipse -Dwtpversion=2.0
Once the command is successfully executed, a new file called org.eclipse.wst.common.component will be created inside the .settings folder of the project.
Start the server and it should pick all the dependent libraries automatically.
This one really has me stumped.
Scenario:
Windows 7 64-bit
Lotus Notes (8.5.2)
Eclipse Helios
Java 6 Update 33 (64-bit) with JDK 7
Installed JRE for the plugin project is set to use the JVM installed under Notes (that is, C:\NotesDev\Notes\jvm).
Target Platform uses the installed JRE above, and imports the framework\rcp\eclipse and framework\shared\eclipse subfolders on the Locations tab. I can see that there are a total of 713 plugins available between the two folders.
The Run Configuration shows a total of 714 plugins selected (which includes the 713 from the Target Platform, and mine). I can see that this list includes both org.eclipse.swt.win32.win32.x86_3.5.2.v34557f-RCP20100710-0200.jar and com.ibm.rcp.swtex.win32_6.2.2.20100729-1241.jar.
The problem:
If I do not explicitly include the two aforementioned JAR files in my build path, the application fails to compile (trying to import org.eclipse.swt.widgets.Display and com.ibm.rcp.swt.swidgets.SToolItem).
If I include the aforementioned JAR files in the build path, the application compiles, but won't run, due to a NoClassDefFound exception.
The questions:
Why do I need to include these files in the first place? They are part of the workspace, and none of the other JAR files I'm referencing seem to need to be explicitly referenced.
Why is this failing at run time? My understanding is that NoClassDefFound occurs because the class was available at compile time, but isn't at run time. But this is occurring on the same machine. (I'm trying to debug it locally, and I've even marked the JAR files for export!)
It seems to me that if the files are listed in the Runtime Configuration's loaded plugins tab, I wouldn't have to explicitly reference them. Am I incorrect regarding this? (Please be kind! I'm admittedly not an expert at this.)
Thanks in advance.
P.S. It's worth noting that if I include the files in the build path, I can see that they are properly referenced in both MANIFEST.MF and the .CLASSPATH file.
MANIFEST.MF CONTENTS
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Plugin
Bundle-SymbolicName: com.satuit.crm.plugin;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.satuit.crm.plugin.Activator
Bundle-Vendor: Satuit Technologies, Inc.
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.apache.axis,
org.eclipse.ui;bundle-version="3.4.2",
org.eclipse.core.runtime;bundle-version="3.4.0",
org.eclipse.ui.views;bundle-version="3.3.1",
com.ibm.rcp.jfaceex;bundle-version="6.2.2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.satuit.crm.plugin,
com.satuit.crm.plugin.document,
com.satuit.crm.plugin.ui,
com.satuit.crm.webservice.agent
Bundle-ClassPath: .,
/NotesDev/Notes/framework/rcp/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.5.2.v3557f-RCP20100710-0200.jar,
/NotesDev/Notes/framework/rcp/eclipse/plugins/com.ibm.rcp.swtex.win32_6.2.2.20100729-1241.jar,
/NotesDev/lib/activation-1.1.1.jar,
/NotesDev/lib/mail.jar,
/NotesDev/lib/commons-lang3-3.1.jar,
/NotesDev/lib/SatuitCRM_XML_API2.jar
** .CLASSPATH CONTENTS **
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.5.2.v3557f-RCP20100710-0200.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/com.ibm.rcp.swtex.win32_6.2.2.20100729-1241.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Workspace/lib/commons-lang3-3.1.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Workspace/lib/activation-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Workspace/lib/mail.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Workspace/lib/SatuitCRM_XML_API2.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.apache.axis_1.4.0.20100729-1241/axispatch.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.apache.axis_1.4.0.20100729-1241/axis.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.apache.axis_1.4.0.20100729-1241/jaxrpc.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.apache.axis_1.4.0.20100729-1241/saaj.jar"/>
<classpathentry exported="true" kind="lib" path="C:/NotesDev/Notes/framework/rcp/eclipse/plugins/org.apache.axis_1.4.0.20100729-1241/wsdl4j-1.5.1.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
You can also get the NoClassDefFound error when a class referenced by Display or SToolItem isn't found. The only way I know to figure out exactly which class can't be found is to run the java app with the -verbose option. You get far more logging than you ever want to see, but somewhere in all those lines of output is an error message naming the specific class that can't be found.
The OSGi MANIFEST won't accept absolute paths to jars on the system (it's for including jars within the bundle), and if you update the Java Build Path it probably won't work when it's deployed.
Fundamentally, you're writing an OSGi bundle and you have to be careful with the classpath. It looks like there are 2 different issues you have to change.
org.eclipse.swt.win32.win32.x86_3.5.2.v3557f-RCP20100710-0200.jar and com.ibm.rcp.swtex.win32_6.2.2.20100729-1241.jar are already OSGi bundles. They need to be in your target platform. Then, you need to add them to Required-Bundles, just like com.ibm.rcp.jfaceex. To be honest, they look like fragments. In that case, org.eclipse.swt.win32.win32.x86 should be picked up automatically because you consume org.eclipse.ui, which re-exports org.eclipse.swt. It might be that you need to add a Require-Bundle on com.ibm.rcp.swtex (a possible host bundle for the win32 swtex fragment)
All of those jars you've added to the Bundle-ClassPath. Are the classes you need not in packages already in your target platform? Ideally you want to consume them from existing OSGi bundles. At least org.apache.axis is already an OSGi bundle. For the rest of them, if you really need classes from those jars and they don't already exist as exported packages in your target platform, you need to either turn them into OSGi bundles and include them in your target platform or actually include them in your eclipse project, and add them to your Bundle-ClassPath from there (it'll be a project root relative path).
Well, as it turns out, the OSGI manifest will accept absolute paths on the classpath. Surprise, surprise.
Whether or not it should is another story. And what that will do to the application once it's deployed is anyone's guess. But the runtime and compile time errors have disappeared, and so far don't appear to be resurfacing.
Once again, what we considered fact and actual fact turned out to be two very different things.
I have Maven project created with Spring roo in STS 2.5.1.RELEASE (It is Eclipse 3.6.1 + Spring tools + m2eclipse). I have second simple Java project on build path. Everything is working ok within Eclipse.
Now the problem is to build. I cannot do so with maven, because it also requires that referenced project is maven project. For referenced project I just use Eclipse Export -> Runnable JAR file to export and generate ant file for next build.
Doing so for first project, I get runtime error, even though META-INF/spring/applicationContext.xml is both is .jar and in the folder next to .jar
2011-02-19 13:58:39,135-org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/applicationContext.xml]
2011-02-19 13:58:39,405-org.springframework.core.io.support.PathMatchingResourcePatternResolver - Cannot search for matching files underneath URL [rsrc:com/company/test/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [rsrc:com/company/test/] cannot be resolved to absolute file path because it does not reside in the file system: rsrc:com/company/test/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
Referenced project is under heavy development, and I cannot move, refactor it or change its nature.
Maven project with Spring roo is parallel version to be developed.
How to build maven project with included eclipse project?
Example.
Project /RooInheritanceMaven has project /RooInheritanceJava on its (eclipse) build path.
.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/RooInheritanceJava"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
It is incompatibility between Eclipse Export to Executable JAR and Spring.
To be more exact it is
org.springframework.core.io.support.PathMatchingResourcePatternResolver
Similar provlem was before. see
#SPR-3815 Classloader problem - Spring Projects Issue Tracker
try
jar -tf PersonApp.jar >PersonApp.jar.txt
The solution is to extract .classes and all stuff from jar into folder
jar xf PersonApp.jar
and run as
set CLASSPATH=D:\TEMP\KDF.MSSQL\antlr-2.7.6.jar;D:\TEMP\KDF.MSSQL\aopalliance-1.0.jar; <... all jar dependecies listed>
java com/company/PersonApp
Look at onejar-maven-plugin http://blog.jayway.com/2009/03/22/executable-jar-with-onejar-maven-plugin/
Use the Roo command
perform package
to get your application bundled - so that you can deploy it into your own container.
We have a project set up with maven for resolving dependancies. It usually works fine, but now I am trying to compile and run it on a new PC and I have problem with missing dependencies in Eclipse.
What is funny is that if I run "mvn package" in console or in eclipse, it works fine and even produces war containing all necessary jars. Only Eclipse complains with "The project was not built since its build path is incomplete. Cannot find the class file for org.slf4j.Logger...". If I compare the project with some other computer (where project works fine), I notice that there are quite a few libraries missing under "Maven dependencies" listing in Eclipse. Eventhough they are in the packaged war and they can be found also under repository folder.
So, the jar-s are there just Eclipse won't list them all under "Maven dependencies". What can I do?
Computer is running on Windows 7 with 64bit java & eclipse.
Well, I tried everything posted here, unfortunately nothings works in my case. So, trying different combinations I came out with this one that solved my problem.
1) Open the .classpath file at the root of your eclipse's project.
2) Insert the following entry to the file:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
Then, rebuild your project at eclipse (Project->Clean-Build).
You now can check at the Java Build Path of you project at the Libraries tab the Maven Dependencies included:
Problem solved!
I don't know what exactly solved it, but I did 4 things in Eclipse:
Window->Preferences: Maven->Installations: Global settings -> open file and hardcoded localRepository
Project->Clean
right click on project: Maven->Update dependencies
right click on project: Maven->Update project configuration
I guess it was the Update dependencies since right after first two there were no change.
I'm also new to Eclipse, and I've been having a similar problem where Eclipse just won't recognize an import statement, even though all signs point to the dependency having been successfully downloaded.
You should check that your dependency file has actually been downloaded by going to the command line and typing
mvn dependency:tree
If you see your package there, then but Eclipse doesn't acknowledge it, the thing that works for me (sometimes) is to go to the terminal, cd into the project folder, and type
mvn eclipse:clean
then
mvn eclipse:eclipse
Finally refresh project in eclipse
I don't know why this works, and sometimes it doesn't work once, then doing it again does work... so worth a try!
I had this issue for dependencies that were created in other projects. Downloaded thirdparty dependencies showed up fine in the build path, but not a library that I had created.
SOLUTION: In the project that is not building correctly,
Right-click on the project and choose Properties, and then Maven.
Uncheck the box labeled "Resolve dependencies from Workspace
projects"
Hit Apply, and then OK.
Right-click again on your project and do a Maven->Update Snapshots
(or Update Dependencies)
And your errors should go away when your project rebuilds (automatically if you have auto-build enabled).
My Project was just screwed up. Here is how I fixed it for Eclipse Indigo x64 (J2EE 3.7.3):
Deleted my POM file (backedup of course).
Project Context Menu > Maven > Disable Maven Nature.
Deleted the project (but not contents on disk).
Re-imported as Import > General > Existing Project.
Project Context Menu > Configure > Convert to Maven Project....
Accept defaults from Maven wizard.
Overwrite POM with your backedup POM. (Now you have Maven Dependencies folder).
Maven Update/Clean for good measure.
Hope that helps someone. :)
Well, I tried everything posted here, unfortunately nothings works in my case. So, trying different combinations I came out with this one that solved my problem.
1) Open the .classpath file at the root of your eclipse's project.
2) Insert the following entry to the file:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
Then, rebuild your project at eclipse (Project->Clean-Build).
For me the problem was maven couldn't find the settings.xml file which is located in myMavenFolder\conf.
What I did to fix the issue was to select the right location of the settings.xml file from eclipse:
Window -> Preferences -> Maven -> User Settings
Finally, hit apply and update your project
Just in case anybody has tried all the other options and you are still stuck, try right-clicking on the project folder, head over to Maven option and click the "add dependency" button. For some reason Eclipse isn't updating the dependencies manually from the pom.xml at first try.
I had a similar problem. I solved it by running the Maven->Update Project Configuration action
So I'm about 4 or 5 years late to this party, but I had this issue after pulling from our repo, and none of the other solutions from this thread worked out in my case to get rid of these warnings/errors.
This worked for me:
From Eclipse go to to Window -> Preferences -> Maven (expand) -> Errors/Warnings. The last option reads "Plugin execution not covered by lifecycle configuration" - use the drop-down menu for this option and toggle "Ignore", then Apply, then OK. (At "Requires updating Maven Projects" prompt say OK).
Further Info:
This may not necessarily "fix" the underlying issue(s), and may not qualify as "best practice" by some, however it should remove/supress these warnings from appearing in Eclipse and let you move forward at least. Specifically - I was working with Eclipse Luna Service Release 1 (4.4.1) w/ Spring Dashboard & Spring IDE Core (3.6.3), and m2e (1.5) installed, running on Arch Linux and OpenJDK 1.7. I imported my project as an existing maven project and selected OK when warned about existing warnings/errors (to deal with them later).
(Sorry, I'm not a designer, but added picture for clarity.)
For the following steps worked in my case:
1 On eclipse, right click on the desired project Maven -> Disable Maven Nature
2 Right click again then go to Properties. Delete every evidence of external Maven dependency leaving only JRE System Library.
3 Right click one more time on the project then go to Configure -> Convert to Maven Project
None of the solutions above worked for me, so this answer is for anyone else in my situation. I eventually found the problem myself, and a different solution. The pom.xml file contained a dependencyManagement tag that wrapped the dependencies, and M2Eclipse would not add the Maven Dependencies folder when this was present. So, I removed this tag, then carried out the solution offered by Ualter Jr., and Eclipse immediately added the missing folder!
Here is the steps which i followed.
1. Deleted maven project from eclipse.
2. Deleted all the file(.setting/.classpath/target) other than src and pom from my source folder.
3. imported again as a maven project
4. build it again, you should be able to see maven dependencies.
This is how I solved it
Window->Preferences: Maven->User Settings (Click on "open file" in resulting window, or just edit settings.xml with an external text editor like Notepad)
Make sure localRepository (which is displayed in this window) is correct. I had a typo in my file.
Once you have corrected settings.xml, click on Update Settings, which is on this same Preferences->Maven->User Settings screen.
Now rebuild, and it will install the latest JAR's in the correct location.
My answer is similar to that of #JerylCook: find another .classpath file in a working Maven project, edit your bad ones as that good working ones. The key is to add
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
in every <classpathentry> of type con and src. Don't forget to change <classpathentry .... /> to <classpathentry ...>xxx</classpathentry>.
At last, update the maven project and reinstall/rebuild in maven.
I got this error when had an error in Pom.
Run mvn eclipse:eclipse command on console to check that pom is parsable or not.
If not parsable search for the error.
If you have "nested paths" errors after performing Maven -> Update Project Configuration (or in Juno it's "Update Configuration...") then your build path is misconfigured.
Right-click project -> Build Path -> Configure Build Path
Ensure that only '/src' and directories at that level are included. If you have e.g. '/src' and also '/src/main/resources' present, this is incorrect. The second resource ('/src/main/resources') is "nested" under the first ('/src') which is causing your inability to import resources, since it prevents eclipse from seeing maven dependencies.
My issue sounds similar so I'll add to the discussion. I had cancelled the import of an existing maven project into Eclipse which resulted in it not being allowed to Update and wouldn't properly finish the Work Space building.
What I had to do to resolve it was select Run As... -> Maven build... and under Goals I entered dependency:go-offline and ran that.
Then I right clicked the project and selected Maven -> Update Project... and updated that specific project.
This finally allowed it to create the source folders and finish the import.
I could solve the error by
1) Right click (your maven project) -> maven -> maven install
After successful installation
2) Right click (your maven project) -> maven -> update project. And the whole error of maven got solved!
For me it was sufficient add a buildCommand (org.eclipse.m2e.core.maven2Builder) and a nature (org.eclipse.m2e.core.maven2Nature) in the .project file, like this:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>iText</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
and I had
I had a similar issue and have tried all the answers in this post. The closest I had come to resolving this issue was by combining the Joseph Lust and Paul Crease solutions. I added the backed up pom.xml file after deleting and reimporting the project, and nothing showed up until I deleted the dependency management tag in the pom.xml and magically the dependencies folder was there.
However, it broke up the child POM's since they need the parent pom.xml dependency management to function, and as a result my MVN was not functioning properly on the project either from Eclipse or the command line, giving a broken pom.xml error.
The last solution if all fails, is to manually import the .jar files needed by your project. Right click the project Properties -> Java Build Path -> Libraries and Add external Jar.
If your MVN is working correctly from the command line and you have done a successful build on the project, you will have all the repos needed in your .m2/repository folder. Add all the external jars mentioned in your dependencies tag of pom.xml and you will see a referenced library section in your Eclipse, with all the pesky red errors gone.
This is not the optimal solution, but it will let you work in Eclipse without any errors of missing dependencies, and also allow you to build the Maven project both from Eclipse and command line.
This same problem happened to me, and it was because there an error in downloading a jar due to repo issues, indicated by a red flag in the pom.xml.
I added another repository so the red flag in the pom.xml disappeared and Eclipse then loaded the pom again, resolved its issue and listed the maven dependencies in Project Explorer. it sounds simple and obvious to resolve visible issues, but since Eclipse was quite happy to run maven, and build successfully, it was not obvious that the red flag and repo issue were at the root of its unwillingness to parse the pom and list the maven dependencies
mvn eclipse:clean
then from eclipse: "Maven Update Project" does the trick!
update the .classpath to below will work every time.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="WEB-INF/" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Maven Dependencies: What solved it for me in Eclipse?
I added the dependency in the "pom" file. I did a build, but could not see the Maven Dependency in the Eclipse.
Next Step: Closed the project.
Then Reopened the project.
I could see the Maven dependencies.
I experienced a similar problem lately after i created a maven project, the maven dependencies folder did not appear in the project structure.To solve this simply add any dependency in the pom file, such as in code below, or right-click on the project and go to maven and select add dependency, search for any dependency such as junit add this, and the maven dependency should appear on your project structure now.
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.9.RELEASE</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Just right click over Project folder and under maven > Update project > Select your project > OK.
it will automatically download all dependencies under pom.xml to folder named Maven Dependencies.
Open the .classpath file at the root of your eclipse's project.
It's so amazing that this one problem has so many different causes and possible solutions. I found yet a different solution that worked for me.
Well, it's not so much a solution but a discovery: I can see the Maven Dependencies node in the Package Explorer, which is the default for the Java perspective, but I can not see it in the Java EE perspective, which uses the Project Explorer by default. Both of those explorers look very similar at quick glance, so you may expect to see the Maven Dependencies in both.
As I was trying to figure this out, I hadn't realized that difference, so it wasn't really a problem for me in the end after all.
the whole project looked weird in eclipse, maven dependencies folder were missing, it showed some types as unknown, but I was able to build it successfully in maven. What fixed my issue was adding gen folder to source path on project build path.
Probably this is similar to this Android /FBReaderJ/gen already exists but is not a source folder. Convert to a source folder or rename it