maven-2

Eclipse Maven web application - can not run on server anymore

拜拜、爱过 提交于 2019-12-03 02:03:35
I have an maven eclipse webapp project that I was able to right click and 'Run on server' and it would deploy on tomcat. I recently did a 'maven -> Update project conifgurations' and I now can NOT deploy and run the project as a webapp. Has anyone seen this before? The only output from tomcat is as follows - it doesnt even look like its trying to deploy the application. Apr 14, 2010 3:58:54 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:

How to programmatically call a Maven-task

家住魔仙堡 提交于 2019-12-03 01:49:41
I'm using Maven in the context of another build-tool (leiningen for Clojure, but this should not matter), and I would like to know how I would call a plugin like dependency:build-classpath programmatically (i.e. via the Maven-API, not via the mvn -command). See how org.apache.maven.plugin.testing.AbstractMojoTestCase from maven-plugin-testing-harness is implemented. Here's a code snippet from some of my tests which may be helpful. public abstract class JAXBGenerateTest extends AbstractMojoTestCase { static { System.setProperty("basedir", getBaseDir().getAbsolutePath()); } protected

Maven pom.xml error in eclipse [duplicate]

风流意气都作罢 提交于 2019-12-03 01:47:44
This question already has answers here : When maven says “resolution will not be reattempted until the update interval of MyRepo has elapsed”, where is that interval specified? (18 answers) I am getting below error in the first line of my pom.xml Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin

Copying file from one project to another in maven

南笙酒味 提交于 2019-12-03 01:47:20
I'm working on a multi-module project. We're using the appCtx.xml from one module in few other modules. Current issue is that they're not always in sync with each other. It happens when someone modifies the file and the project builds, the person doing that can forget to copy to another module and it causes issues. How do I copy appCtx.xml inside src/main/resources from project A to src/main/resources in project B? You can do this with the maven resources plugin: copy-resources , something like: <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-appCtx<

What is the best way to launch HSQLDB for unit testing, when working with spring, maven and hibernate?

旧城冷巷雨未停 提交于 2019-12-03 01:44:39
In my project I can successfully test database code. I'm using Spring, Hibernate, HSQLDB, JUnit and Maven. The catch is that currently I have to launch HSQLDB manually prior to running the tests. What is the best way to automate the launching of HSQLDB with the technologies being used? I am assuming that with hsql you are referring to HSQLDB . Configure your database url for JDBC drivers (for hibernate etc) to embedded memory based version of HSQLDB: jdbc:hsqldb:mem:myunittests Then a inprocess version of HSQLDB automatically starts that stores stuff to memory. No need to start any external

src/main/webapp directory not recognized by Eclipse

自作多情 提交于 2019-12-03 01:43:49
I use m2eclipse to import Maven Java projects in Eclipse. It fails to recognize src/main/webapp as a source directory. Graphically in the package explorer (or when I look into Java-Build-Path in the project's properties), this directory isn't in the list of sources folder (while src/main/java or src/main/resources do). To access it, I have to look directly into the src/ directory, and start unfolding... Not very convenient! However, if I run maven install , the resources are copied to the correct directory. (example : src/main/webapp/index.jsp to target/mywar/index.jsp ) Questions Is this a

How do I install Maven with Yum?

不打扰是莪最后的温柔 提交于 2019-12-03 01:34:42
问题 I'm trying not to learn much about either yum or maven. I've inherited this code and I don't want to spend more time than I have to in this environment. I've got yum. My installation "has" ("is attached too"? "knows about"?) two repos: the Amazon one and JPackage, which I understand is something of a standard. (Actually, each of those repositories consists of two sub-repositories, but I don't think that's causing the problem.) When I asked yum to install maven2, it declined, saying it had

Calling Maven goals from Java

浪子不回头ぞ 提交于 2019-12-03 01:30:17
Is it possible to call Maven goals from Java, for instance, can I do the equivalent of: mvn clean package from a Java class? thanks, Nick dfa absolutely, you need to use the Maven Embedder API . Updated link is http://maven.apache.org/ref/3-LATEST/maven-embedder/index.html This is easy :) Java code MavenCli cli = new MavenCli(); cli.doMain(new String[]{"clean", "package"}, "project_dir", System.out, System.out); Project configuration: <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-embedder</artifactId> <version>3.1.1</version> </dependency> <dependency>

How to deal with relative path in Junits between Maven and Intellij

时间秒杀一切 提交于 2019-12-03 01:29:16
问题 I have a maven project with a module /myProject pom.xml /myModule pom.xml /foo bar.txt Consider a Junit in myModule which needs to open bar.txt , with maven the basedir is the module directory. So to open the file bar.txt : new File("foo/bar.txt") This works well when you execute mvn test BUT when you launch the same junit in intellij , it fails because Intellij sets the basedir in the project directory, not the module directory. Intellij tries to open myProject/foo/bar.txt instead of

If I run mvn deploy does it build new artifacts or it just deploy the already existing artifacts in to the remote server?

蹲街弑〆低调 提交于 2019-12-03 01:22:58
Note: This question has been originally posted by Lahiru Gunathilake as an answer to another question . I'm moving it here as a separated question for the sake of clarity. When we are doing a release we just build in our local machine and do the QA and then we host it in to repository. If we run mvn deploy does it create new artifacts, this cause having different artifact in the repository and in binary distribution because we are creating the binary distribution from our local repository. But if someone get the source code and do the build they'll get a different one. But if mvn deploy doesn