I have wasted a 4 hours on finding a reason for not adding of webflow jars tp the reference library of my my modular maven project which is generated from appfuse.I want to add a webflow to this project. But when I do the registering as below, I get an error (I have still not run the project).
error is
Multiple annotations found at this line:
- Class 'org.springframework.webflow.mvc.servlet.FlowHandlerAdapter'
not found
But I have included the webflow dependencies in my pom in my web module project. But when I go the the reference library I can not find the webflow jars as well. I think this is the reason for this, But I can not wind a way to get the jars in to the reference library.
The generated pom is very lengthy. I will add it if it is needed.
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.2.RELEASE</version>
</dependency>
Is there a compatibility issue with the spring versions. I am currently using 4.0.0.RELEASE I have changed it to 4.0.2.RELEASE as well. But no luck. I can not find a meaningful solution for this. I really appreciate some help on this.
Thanks
In Eclipse, right click the project and go to build path -> configure build path
From here, go to libraries and check that the Maven dependencies library is in there.
If its not click add library click maven managed dependencies, next, finish
Should add the libraries to the eclipse project
Related
I am following an online tutorial, and am stuck trying to get Spring libraries to run things with. The instructions are either a little out of date or assume I know how to do things in a Maven world that I do not.
They give web addresses on the Spring site from which they say I can "download the jars". But you can't download jars from any of them; evidently what you can do is find pom.xml fragments and use them to download jars. If you know how.
For example: the tutorial says:
Finally, following is the list of Spring and other libraries to be
included in your web application. You simply drag these files and drop
them in WebContent/WEB-INF/lib folder.
commons-logging-x.y.z.jar
org.springframework.asm-x.y.z.jar
org.springframework.beans-x.y.z.jar
org.springframework.context-x.y.z.jar
org.springframework.core-x.y.z.jar
org.springframework.expression-x.y.z.jar
org.springframework.web.servlet-x.y.z.jar
org.springframework.web-x.y.z.jar
spring-web.jar
I love the "simply" here.
I have many but not all of these (version 3.2.4). I have googled the library names and used jarfinder for the ones I don't have, but haven't found them all. It seems to me I'm flailing around a bit, just trying this and that until something works. I hate that.
I'm hoping someone can give me a set of steps I should follow when faced with this sort of thing, since we're faced with it all the time. Do I need to stop my current study of programming and learn Maven inside and out so that I can configure the bloody system so I can program again?
Is it a maven project you have?
If so in the pom.xml you just need to place the “pom fragments” in the xml.
i.e. between the dependencies tags. For example,
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
</dependencies>
Once you have done that run maven install. Under Eclipse it is: run as > maven install.
That will download all the dependences i.e. jars you have listed into the you local maven repository.
I think the default is C:\Users\yourName\.m2\repository
Found most of the needed jar files here:
http://www.java2s.com/Code/Jar/CatalogJar.htm
while I downloaded commons-logging here:
http://mvnrepository.com/artifact/commons-logging/commons-logging/1.2
My advice is, stop study you program language, Java I guess and learn how to integrate maven dependencies of Spring in your Maven project.
http://spring.io/blog/2009/12/02/obtaining-spring-3-artifacts-with-maven/
You cannot start the house from the roof
I don't understand how does jar builds from our application.
project structure looks like this:
parent
--child1
--child2
...
--child10
Research child2.jar
child2/pom.xml has 20 dependies
child2.jar/OSGI-INF/lib contains only part of this dependies(jar==dependency)(<20)
I am bad with maven - please help to find place where this list configures?
A dependency added in pom.xml will download all jar files required for that entry. For example if a dependency API is based on Spring MVC, by adding the dependency in pom.xml it will download the Spring jars required for that as well.
Its always better to use maven whenever you go for a new project as it helps building and wrapping the war file much easier.
You can refer Maven in 5 mins for a quick glance of functionalities.
Findjar will help you identify the pom dependencies for almost all class/jar files
I'm building a web application with Eclipse using Maven. The server is going to be Apache Tomcat. Eclipse already has tomcat 6 libraries which you can include in your build path and Web Application Module facet to be chosen. That's the way I work without Maven.
However, Maven is able to include the required dependencies to use them in tomcat. My question is, what is the right thing, not to include them via Maven and continue doing that like before, or not to configure eclipse build path and make maven solve it?
The best approach for container specific API like the server API is include it in the maven POM however set the dependency as provided scope so it will be available in your class path for eclipse however maven will not package it in the WAR file when generating it. e.G.
<dependency>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<scope>provided</scope>
</dependency>
As far as I know Maven do not solve it, if you do not specifically say that your project needs these dependences. The best way is to configure the pom.xml and set the dependencies and build the project using Maven and edit it in eclipse. So once you are done you can easily "package" (build the war) and deploy it in any server location.
I have a Maven project (ejb container) where I need to use the jcifs library.
I made the entries in pom.xml like:
<dependency>
<groupId>jcifs</groupId>
<artifactId>jcifs</artifactId>
<version>1.3.17</version>
<type>jar</type>
</dependency>
Everything is okay, I see the jar file inside the ear package, I see it also in the dependencies of the project, I can use the classes but at runtime I get:
javax.ejb.EJBException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: jcifs/smb/SmbFile
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
What am I doing wrong?
Right-click the webproject and go to properties -> Java EE Module Dependencies. Check the Maven dependencies is checked.If not check and redeploy .
I would like to help the people who are as stupid as I am. This is not really the about the same scenario as asked for in this question, but this question helped me to figure out my problem.
I wrote a little code in a scratch file, in my case in Intellij. Before that I added the jcifs dependency to my maven project, assuming that the scratch file would find it there, which in hindsight is a bit stupid, because how would the scratch space know.
So my hint is to have a look where the dependency will actually have an effect, i.e. is available - compile time, runtime, scratch space?
Also I wanted to mention that I used this library, which works very fine for me https://github.com/hierynomus/smbj.
So in my case I edited the run configuration so that it would take the maven modules configuration into the classpath.
So my guess is that #SANN3 's answer is correct for the actual question.
I'm having some issues making the maven google app engine plugin work properly.
First of all, I'm not even sure if the archetype I'm using is the correct one, their examples show version 0.7.0 but it seems like never versions exist (i tried 0.9.1 and that works), where can I find a overview of what versions of the plugin is available?
Secondly, the archetype seems.. messy, I don't like the package structure and it doesn't seem to actually include the GAE and GWT dependencies. I have to manually add them to my project in Eclipse, which kind of defeats the purpose of using maven. And how come they are breaking the gwt maven plugin? I know that one includes the actual gwt jars as maven dependencies?
I'm fairly new to Maven, but I have been using the gwt maven plugin for a while, and I'm very happy with everything about it. Is there any way I could just their archetype to do the base project and add the gae plugin to it?
UPDATE
I suspect the problem I'm seeing with the GAE maven plug-in is in regards to undefined properties in the POM. I have no idea if its due to error these aren't set-up or if its due to me actually have to manually set them up. The documentation on this plugin is sparse.
Thanks for the answer below, but I really don't want to add another archetype into play. I think the best solution for me is to try and adapt a GWT maven project manually, to include support for GAE.
I've used the archetype like so :
http://code.google.com/p/gae-mvn-archetype/
to generate a GAE project template.Then manually added my other dependencies. This got me a usable project which I can deploy to GAE and everything.
Also, for Eclipse importing, once the template project was done, I've imported it into eclipse using the m2_eclipse plugin :
http://m2eclipse.sonatype.org/installing-m2eclipse.html
(note that i've imported it into Eclipse as a Maven project, NOT as an Eclipse whatever project)
This imported the thing into eclipse with all the necessary dependencies and without errors.