maven-2

Different files to be packaged in a Maven war project

狂风中的少年 提交于 2019-12-19 04:07:48
问题 I have a war packaging Maven project, in which I have a Java properties files called myapp.properties. In this properties file, I store some parameters, for example, database connection parameters, which will be used by the webapp. Either in a continuous integration environment or in my development environment, I want to set some testing parameters in myapp.properties to connect to my test database for example. At the same time, I want to leave these parameters blank in my final war package

Is there an easy way to generate an Ant build script from a Maven POM?

◇◆丶佛笑我妖孽 提交于 2019-12-19 03:24:14
问题 We have a project that uses Maven as its build/dependency management tool. But our code needs to be compiled at our client's site and our client demands that we deliver build scripts written for Ant. So, we would like to keep working with Maven and automatically generate the Ant scripts when we need to deliver the code to the client. Can we do that? 回答1: You can use the Maven Ant Plugin. 来源: https://stackoverflow.com/questions/2056729/is-there-an-easy-way-to-generate-an-ant-build-script-from

Maven - 'all' or 'parent' project for aggregation?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 03:21:19
问题 For educational purposes I have set up a project layout like so (flat in order to suite eclipse better): -product | |-parent |-core |-opt |-all Parent contains an aggregate project with core, opt and all. Core implements the mandatory part of the application. Opt is an optional part. All is supposed to combine core with opt, and has these two modules listed as dependencies. I am now trying to make the following artifacts: product-core.jar product-core-src.jar product-core-with-dependencies

How do I configure an additional context path for Maven-Tomcat plugin?

痞子三分冷 提交于 2019-12-19 03:16:34
问题 I'm using Maven 3.0.3 with the Tomcat plugin. Using Maven and Tomcat, I would like to deploy an embedded instance of the site. My question is how do I configure an additional context path in my embedded Tomcat server? Below is my Tomcat configuration, but either my "" specification is invalid or the contents of that file (below) are invalid … <Context path="/all-new-jx-web" docBase="/Users/davea/Documents/workspace/NissanUSA2/Technology/nna/mycousa/jx/target/web"> because when I invoke mvn

How do I configure an additional context path for Maven-Tomcat plugin?

為{幸葍}努か 提交于 2019-12-19 03:16:06
问题 I'm using Maven 3.0.3 with the Tomcat plugin. Using Maven and Tomcat, I would like to deploy an embedded instance of the site. My question is how do I configure an additional context path in my embedded Tomcat server? Below is my Tomcat configuration, but either my "" specification is invalid or the contents of that file (below) are invalid … <Context path="/all-new-jx-web" docBase="/Users/davea/Documents/workspace/NissanUSA2/Technology/nna/mycousa/jx/target/web"> because when I invoke mvn

Delivering a single jar with a Maven project

核能气质少年 提交于 2019-12-19 02:05:12
问题 I want to deliver a single .jar file to my clients, but my project is currently built with Maven, and I have several modules that generate a single .jar each. I know nesting different .jar files is not a great idea, so I am not sure how can I achieve this. Any ideas? 回答1: First of all, ask yourself if you have a really good reason for packaging your application and all of its dependencies in to a single jar. I haven't found a very many good reason for this at all (with most reasons being

Writing an annotation processor for maven-processor-plugin

北慕城南 提交于 2019-12-19 01:28:37
问题 I am interested in writing an annotation processor for the maven-processor-plugin. I am relatively new to Maven. Where in the project path should the processor Java source code go (e.g.: src/main/java/...) so that it gets compiled appropriately, but does not end up as part of my artifact JAR file? 回答1: The easiest way is to keep your annotation processor in a separate project that you include as dependency. If that doesn't work for you, use this config Compiler Plugin: <plugin> <groupId>org

Maven cobertura plugin - one report for multimodule project

橙三吉。 提交于 2019-12-19 01:05:51
问题 I'm using maven cobertura plugin to report code coverage in my multimodule project. The problem is that I don't know how to generate one report for all modules in project. So far I have generated separate reports for every module, but it would be nice to have one report for whole project. My parent pom configuration: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.4</version> <inherited>true</inherited> <executions> <execution> <phase

Eclipse Maven Plugin Configuration Problem

不问归期 提交于 2019-12-18 23:43:12
问题 I have followed this thread now when i try to build using maven plugin installed i am getting following error. goal i executed was clean -X install Unable to locate the Javac Compiler in: C:\Program Files\Java\jre6\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can change the location of your Java installation by setting the JAVA_HOME environment variable. -> [Help 1] org.apache.maven.lifecycle

Maven Javascript Compressor

喜欢而已 提交于 2019-12-18 21:19:10
问题 I want to know how one can compress javascriptfiles using maven. I have lready visited webistes like http://mojohaus.org/javascript-maven-tools/guide-webapp-development.html but there is no implementation explained. I want to know the dependency for executing the maven plugin. 回答1: I suggest using the YUI Compressor Maven Mojo and its yuicompressor:compress goal instead. It is well documented, it just works. To use it, add the following pluginRepository : <pluginRepositories>