maven-2

Spring 3, Jersey (JSR-311) and Maven dependencies

做~自己de王妃 提交于 2019-12-05 17:58:31
问题 im currently struggling to integrate a REST Service based on Jersey and Spring. I'm using Spring 3.0.2-RELEASE and jersey-spring 1.2. But jersey-spring adds a dependency to Spring 2.5.6 to my project which of cause conflicts with the 3.0.2-RELEASE to give me thefollwing error: 11:58:25,409 ERROR org.springframework.web.context.ContextLoader:215 - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class

Unbelievable: Cannot cast from class X to its super class

不羁的心 提交于 2019-12-05 17:57:27
I'm encountering a very weird problem with Spring (3.0.1.RELEASE), TestNG (5.11) and Maven Surefire (2.5). I have a test class that extends a Spring helper class for testNG so that test context can be loaded from an xml file (that contains some bean definitions). My project was imported into eclipse using m2eclipse (using Import Maven Project) The class run fine in Eclipse TestNG runner. However, it throws this exception with Maven Surefire Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers

How to populate web application with initial data

血红的双手。 提交于 2019-12-05 17:43:07
问题 I am writing web application and am wondering what the recommended way is to populate initial data. This is JPA/Hibernate and Spring application and is built by maven. Up to now I've used script wich populate database with initial data, started by hand. Unit tests work with theirs own data, created in code before each test. My test classes extends org.springframework.test.jpa.AbstractJpaTests . Finally I'd like to have a maven build which create database form entities (now I need to run

maven, jsp files in dependency

橙三吉。 提交于 2019-12-05 17:41:43
问题 I'm using maven2 for dependency management. I have one project that contains some Java files and some jsp files and another project, a web project, that depends on the first project. How do I access the jsp files from the web project? I can see that the jsp files are added to 1-0-SNAPSHOT-sources.jar and not 1-0-SNAPSHOT.jar (which is added as a dependency in the web projects pom.xml). 回答1: I think the correct Maven-way to do it would be to put the JSP files in your web project under /src

Can I use the AdMob SDK jar as a dependency in my maven android project?

冷暖自知 提交于 2019-12-05 17:29:24
I'm just switching my build process to use maven, I can't find the dependency for AdMob on the maven repository site, how can I configure it manually? Such as : <dependencies> <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <version>2.2.1</version> <scope>provided</scope> </dependency> </dependencies> An easy way to do this is to have the lib in your source tree and use this: ... <dependency> <groupId>some_admob_groupid</groupId> <artifactId>admob</artifactId> <version>admob_version</version> <scope>system</scope> <systemPath>${basedir}/lib/admob.jar<

Netbeans & Maven: different compilation behavior

…衆ロ難τιáo~ 提交于 2019-12-05 17:10:25
I am using Netbeans and Maven projects. In some case Netbeans show me compilation failures (red ballon) BUT Maven compile everything without any problem! What can be the reason of this difference. I already checked that both are using the same JDK version. One possible reason could be that you have not added the required jar in your net beans class path. But the jar is being listed in your maven pom.xml Try doing this, do an mvn install once from your command line in your project directory, and then re-open or reload the project in your netbeans IDE (I hope you are using 6.9?). This will

VisualVM breaks jetty

坚强是说给别人听的谎言 提交于 2019-12-05 16:55:43
I'm trying to profile application that is run by "mvn jetty:run", when I connect VisualVM to it and click on Profile jetty crashes with: Profiler Agent: Waiting for connection on port 5140 (Protocol version: 8) Profiler Agent: Established local connection with the tool # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6da5e5d4, pid=5124, tid=5704 # # JRE version: 6.0_16-b01 # Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode windows-x86 ) # Problematic frame: # V [jvm.dll+0x1ae5d4] # # An error report file with more

Maven Exec Plugin not reading configuration

拟墨画扇 提交于 2019-12-05 16:35:19
I'm trying to execute my project using the Maven exec:exec goal and I've tried to configure it with this snippet: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> <configuration> <executable>java</executable> <arguments> <argument>-jar ${staging.dir}/project.jar</argument> </arguments> </configuration> <executions> <execution> <goals> <goal>exec</goal> </goals> </execution> </executions> </plugin> When I run mvn exec:exec I get the output: ------------------------------------------------------------------------ [ERROR]BUILD ERROR

IntelliJ not seeing resources folder

放肆的年华 提交于 2019-12-05 16:34:25
问题 I created a new Project from scratch in IntelliJ by using a Maven Module . I didn't select any specific archetypes and I clicked on finish. The project gets created nicely and I have the java and resources folders under src/main as expected. Unfortunately, my application does not find any property files in the resources folder because it looks in the project base folder instead. I double checked that the resources folder is marked as 'source folder' in the Project Structure and I also tried

run maven tests from classpath

可紊 提交于 2019-12-05 16:34:09
In order to clean up something of a giant mess, I set out to put the code of my tests all in one ordinary java project (all in src/main/java), and then declare that as a <scope>test</scope> dependency in another project, and expect the tests to run. No such luck. surefire wants to just run the tests that it can see in the sources. I can see a sadly obvious solution here involving the build-helper-plugin and adding the tests into the test compilation environment as a source directory, but I was hoping to avoid it. In case anyone is wondering, the reason for all this is that the POM