maven-2

How to handle maven versions in a multi module project?

懵懂的女人 提交于 2019-12-03 07:48:17
I have a maven project infrastructure like this: /trunk/all/pom.xml /trunk/all/libs/lib1/pom.xml /lib2/pom.xml ... /trunk/all/projects/p1/pom.xml /p2/pom.xml ... You see, I have a lot of libraries and a lot of projects using these libraries. All this is combined to one multi module project, because I like to import the top project into eclipse and have all my libraries and projects available at once only do a single mvn test to compile and test all my code after I've done some global refactorings. Currently, all my modules are version 1.0-SNAPSHOT . Now I want to release project p2 and all

How can I ask Maven for a list of the default repositories?

陌路散爱 提交于 2019-12-03 07:44:17
问题 What command can I use to ask Maven for a list of the default repositories that it searches for its dependencies? If no such command exists, where else may I look to find this default list? 回答1: on the command line, execute mvn help:evaluate then, when prompted, enter ${project.repositories} see http://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html 回答2: You can output the effective pom with the command mvn help:effective-pom There the default repositories are listed. 回答3: Use

how to prevent maven from checking foreign repositories?

拜拜、爱过 提交于 2019-12-03 07:37:00
When I build using maven I see it checking all sort of foreign repositories for artifacts which only my local build should produce. How can I tell it that the com.myorg group can only be found in the local repository? Basically I want to do what m2eclipse does with workspace resolution but on the command line. [INFO] snapshot com.myorg:core:0.0.1-SNAPSHOT: checking for updates from sun-jms [INFO] snapshot com.myorg:core:0.0.1-SNAPSHOT: checking for updates from hibernate [INFO] snapshot com.myorg:util:0.0.1-SNAPSHOT: checking for updates from sun-jms [INFO] snapshot com.myorg:util:0.0.1

How do I run a specific goal with a particular configuration in a Maven plugin when I have several configurations for that goal

╄→гoц情女王★ 提交于 2019-12-03 07:34:27
问题 See plugin config from pom.xml below. I can do: mvn myplugin:myGoal Which runs myGoal (both executions I suppose) but I want to be able to choose either the first or the second executions independently. I know I can add an id to the execution element, but how do I refer to that id on the command line. I'd like to get to something which does what this imagined command does: mvn myplugin:myGoal --executionId=1 Is this possible, or am I going about this the wrong way? <plugin> <groupId>org

How to convert file separator in maven

牧云@^-^@ 提交于 2019-12-03 07:29:00
I have a property defined like this: <properties> <main.basedir>${project.parent.basedir}</main.basedir> </properties> Since I use Windows as OS, it contains backslashes. I want to add this path to a glassfish domain as JVM option (using glassfish maven plugin). The problem is, that asadmin can consume only slash as separator, and all my backslashes keep on disappearing. How can I define a property with exactly the same content with slashes? I don't think there is a non-programmatical way to do that. So I suggest a groovy one-liner with the Maven GMaven plugin (GMaven is usually the simplest

Maven won't run tests

孤者浪人 提交于 2019-12-03 07:26:45
When running mvn test maven won't run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run. Here's my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>example</artifactId> <version>1.0</version> <properties> <java-version>1.6</java-version> <org.slf4j-version>1.6.6<

How to: database versioning with maven2?

一曲冷凌霜 提交于 2019-12-03 07:16:49
I am finding any maven plugin for versioning database changes. There are a few plugins that offer some support for this task: Maven LiquiBase Plugin Maven Database Migration Plugin DbMaintain Maven Plugin (a plugin for DbMaintain , the famous tool from Unitils) I don't have much experience with them, we currently use a custom tool to apply our change scripts. But the Maven Database Migration Plugin is a serious candidate to replace it. LiquiBase is pretty famous but also different, changes are described in a generic XML format. About DbMaintain, it works well (in Unitils) but I've never tested

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

眉间皱痕 提交于 2019-12-03 07:12:03
问题 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? 回答1: The recommended way is to use the Maven Integration for Android Development Tools and the Maven Android Plugin provides instructions. From the Eclipse

Maven: how to filter the same resource multiple times with different property values?

こ雲淡風輕ζ 提交于 2019-12-03 07:08:30
问题 Our project uses Log4J, configured via log4j.properties file. We have multiple production servers, which log to different log files, so that the logs can be differentiated. So log4j.properties for node 1 looks like this: ... log4j.appender.Application.File=D:/logs/application_1.log ... log4j.appender.tx_info.File=D:/logs/tx_info_1.log ... while the log4j.properties for node 2 looks like ... log4j.appender.Application.File=D:/logs/application_2.log ... log4j.appender.tx_info.File=D:/logs/tx

Maven Buildnumber plugin - Git

流过昼夜 提交于 2019-12-03 07:01:10
问题 The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a workaround for the time being? I recently switched from SVN to GIT and have found it to be an easy transition, but this is the only thing that I don't have working presently. Walter 回答1: Well, there is MOJO-1199 about the buildnumber plugin and GIT support but the patches haven't been applied yet. However, it seems that Antony Stubbs did some work around this and made it available in this git mirror. Have a look at