maven-2

spring - @ContextConfiguration fail to load config file in src/test/resources

烈酒焚心 提交于 2019-12-03 01:16:15
I've tried to load the spring config file in src/test/resources classpath with the following abstract class: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:/applicationContext.xml"}) public class BaseIntegrationTests { } I have the applicationContext.xml file in src/test/resources but spring cant load it. Thank you. To be precise, it's the content of the test output directory ( target/test-classes ) that is on the class path, not src/test/resources . But resources under src/test/resources are copied to the test output directory by the resources

In Maven2, what's the simplest way to build a WAR and the EAR to contain that WAR in a single POM?

会有一股神秘感。 提交于 2019-12-03 01:13:48
Situation is pretty straightforward. I have a Java webapp that I'm converting to be built with Maven. At present, the app is built with Ant into a single WAR file, which is then bundled into an EAR with a very simple application.xml. maven-war-plugin and maven-ear-plugin both look pretty straightforward to me, and it appears they're setting me up to be forced to consider the above as two distinct projects, with the WAR project as a dependency of the EAR project. This seems a tad inconvenient, especially because a profile setting of the WAR project will change for each environment, which seems

Multiple Dependency Scopes in POM

独自空忆成欢 提交于 2019-12-03 01:03:23
I have a dependency in my POM that needs to be set to "provided" so it is not included at compilation, but it can still be referenced within my project. I would like the same dependency to have a scope of "test" when I go to run tests so I do not have to manually add the jar to my classpath. Is there a way to do this or achieve similar results? Reasoning behind this is that I have some common jars that are provided in my JBOSS lib directory, so I want to use these and keep the "provided" scope of them for the war that is built. However, when I run JUnits from the command line, I want to use

Why is javac 1.5 running so slowly compared with the Eclipse compiler?

自古美人都是妖i 提交于 2019-12-03 00:19:03
I have a Java Maven project with about 800 source files (some generated by javacc/JTB) which is taking a good 25 minutes to compile with javac. When I changed my pom.xml over to use the Eclipse compiler, it takes about 30 seconds to compile. Any suggestions as to why javac (1.5) is running so slowly? (I don't want to switch over to the Eclipse compiler permanently, as the plugin for Maven seems more than a little buggy.) I have a test case which easily reproduces the problem. The following code generates a number of source files in the default package. If you try to compile ImplementingClass

Using Maven for Coldfusion project

我怕爱的太早我们不能终老 提交于 2019-12-03 00:11:45
I have to deal with what is pretty ugly and large blob of ColdFusion code which up to this day is maintained by direct modifications on production server (don't ask). I managed to clean it up from dupes and backups and put it into Subversion, now I need tp pick a make system to be able to put this onto continuous build (TeamCity) and also scheduled releases. To my surprise I only found pretty much a single blog article on how to retrofit CF project with Maven , so the question is - does anyone have experience successfully using Maven on CF and what in general people use to manage large CF

Maven2 & Swing projects: Build & run swing application

六月ゝ 毕业季﹏ 提交于 2019-12-02 23:40:35
I tried to find info on how to use maven to build and run a swing application but couldn't find anything useful (maven documentation is a mess). Can someone point me to relevant documentation? Is anyone using maven in swing development ? I'm guessing that you want to run your app from a maven command. You can use the exec plugin like this: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1-beta-1</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>com

Uploading a File via SCP with Maven fails

橙三吉。 提交于 2019-12-02 23:37:43
I try to upload an ear created by maven to an application server using scp. When I tried to run mvn wagon:upload-single But I get the following error: [ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload-single (default-cli) on project de.volkswagen.dps.ear: Unable to create a Wagon instance for null: url can not be null -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload-single (default-cli) on project de.volkswagen.dps.ear: Unable to create a Wagon instance for null

generating Eclipse project files with Maven

对着背影说爱祢 提交于 2019-12-02 22:57:55
When I try and generate the Eclipse project files using mvn eclipse:eclipse I get the following error: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse': Unable to load the mojo 'org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse' in the plugin 'org .apache.maven.plugins:maven-eclipse-plugin'. A required class is missing: org/codehaus/plexus/resource/loader/ResourceNotFoundException It appears that I'm using version 2.9-SNAPSHOT of the Maven Eclipse plugin. My guess is that there is a bug in this version of

Maven with Android - R.java file generation (Eclipse)

ぐ巨炮叔叔 提交于 2019-12-02 22:00:49
I am trying to get working R.java generation to project in gen folder. Actually, the application builds, when using maven build, however eclipse finds error, because it can't resolve R.java file (which actually is being put in /target/generated-sources/r/R.java location after each build). What is the suggested way to solve the problem? The recommended way is to use the Maven Integration for Android Development Tools and the Maven Android Plugin provides instructions. From the Eclipse Integration page: Introduction Android's official development effort provides solid support for Eclipse

Removing version number from file name with Maven

梦想与她 提交于 2019-12-02 21:39:25
I have a project with 5 modules in maven. Right now, when I do a "mvn clean install", it generates an ear containing the two jars, one war and one sar from the other modules. All the file names contain the version, e.g., projectx-ear-2.0.0.ear, projectx-client-2.0.0.jar, etc. I need to rename one of the jars and the final ear to omit the version in the file name. It should look like this: projectx-ear.ear | +-- projectx-client.jar | +-- projectx-misc-2.0.0.jar | +-- projectx-sar-2.0.0.sar | \-- projectx-web-2.0.0.web Right now I'm using the following plugins to build: maven-compiler-plugin and