maven-2

Simulating the Maven2 filter mechanism using Ant

一曲冷凌霜 提交于 2019-12-18 04:19:10
问题 I have a properties file, let say my-file.properties. In addition to that, I have several configuration files for my application where some information must be filled regarding the content of my-file.properties file. my-file.properties: application.version=1.0 application.build=42 user.name=foo user.password=bar Thus, in my configuration files, I will find some ${application.version} , ${user.name} that will be replaced by their value taken in the properties file... When I build my

How to merge module jars to a single jar in Maven2?

佐手、 提交于 2019-12-18 03:56:47
问题 I have a maven2 project with several jar modules, build the project will get .jar archives for each module in the directory modules/XYZ/target/XYZ-x.x.x.jar Now, if my project P is of version P-p.q.r, and I want to generate a single jar P-p.q.r-all.jar with all sub-modules included in, how should I do? 回答1: What you want to achive is called uber jar . This module has to have dependecies of all others submodules you want to package into one jar. If you create another submodule that will

maven repository mirrors

与世无争的帅哥 提交于 2019-12-18 03:56:37
问题 Normally, I have the following mirror configured in my Maven settings.xml <mirror> <id>internal-repository</id> <url>http://build.idaho.local/wtp_repository</url> <mirrorOf>*</mirrorOf> </mirror> My understanding is that this mirror prevents Maven from downloading dependencies from the internet, i.e. it will only look for them in this internal repository. However, whenever I want to add a dependency that isn't in this internal repository, I have to comment out the text above and add the

Maven - resource filtering : implications of the @ symbol in resource files

試著忘記壹切 提交于 2019-12-18 03:56:25
问题 I am using the Maven assembly plugin to prepare some configuration artifacts for different environments, and I am using resource filtering to substitute parameter values. I came across a weird behaviour where I had a property file with the contents as follows: ########################### # author.name@company.com # ############################ env.name=${replacement.value} The presence of the '@' symbol for the author's e-mail was causing all property references to be ignored. I have tried

Is it possible to split maven pom files?

放肆的年华 提交于 2019-12-18 03:49:28
问题 Is it possible to include several smaller pom files to create the parent pom file. (e.g. I would like to split the reporting, build sections into their own poms and include them in the parent pom) for managing them effectively 回答1: If you are using Maven 2, you can simply create several parent levels. The first pom.xml ( pom1 ) will define the basic properties (such as repositories for example). The second pom.xml ( pom2 ), which has pom1 as <parent> , will define the reporting information.

Automating NSIS script build using maven2

放肆的年华 提交于 2019-12-18 03:46:56
问题 We have developed a script using NSIS Version 2.46 which would generate a installer for windows. Now that we would want to automate the build process of generating the installer by taking help of maven. We currently use maven for building our java code projects and for building our end product. For automating the build process of NSIS script, I am not able to find the maven plugin information which supports NSIS script build. I googled for the information but I did not get any concrete

How to start and stop an Tomcat container with Java?

≯℡__Kan透↙ 提交于 2019-12-18 03:25:16
问题 I have a Maven project that starts a tomcat container for pre-integration-tests (jUnit Tests). Most of my tests require that the web-application under tests is restarted. So I'd like to restart the Tomcat container before each jUnit test is executed. As for now I use the cargo-maven2-plugin to configure the tomcat container. So, is it possible to start and stop the container with a java statement? 回答1: So, is it possible to start and stop the container with a java statement? Your use case

Specify common resources in a multi-module maven project

一笑奈何 提交于 2019-12-18 03:01:53
问题 Is there any way to share resources between modules of a parent project in Maven? For example, I would like to specify one log4j.properties file for all the modules in a multi-module Maven project. Generally, I use Eclipse IDE to create the parent project by choosing a general project and then convert it to a Maven project by specifying a packaging of pom . This creates a "clean" project structure without src and etc. folders. I wonder where such a shared resource should be put in this case.

enabling UTF-8 encoding for clojure source files

醉酒当歌 提交于 2019-12-18 02:42:14
问题 I'm working on a project which involves maven, java and clojure. The problem I'm facing is this, I have some UTF-8 chars in my clojure source files because of which my source code is not interpreted correctly by the java compiler, I kinda got it working by setting the environment variable JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 , but what I want is to pass this property through MAVEN. I have already tried setting MAVEN_OPTS=-Dfile.encoding but this doesn't seem to work. I have also tried

Running JUnit tests with Maven under Eclipse

强颜欢笑 提交于 2019-12-18 02:41:49
问题 I just installed the plugin m2e for the first time on Eclipse. I wrote a simple JUnit (version 4) test. I can run it from Eclipse, but not from the pom.xml (alt-click, Run as, Maven Test). I suppose I need to tell Maven to search for that class, but I just don't know how. Also, I couldn't find JUnit 4 in the groupId "junit": only the version 3.8.1 is available. Do I really need to write tests for version 3.x and not version 4+? How to fix this? Think of me as a newbie with Maven: that's