Maven command to list lifecycle phases along with bound goals?

The buildplan-maven-plugin is an excellent tool for showing how goals are bound to phases. Below are examples of commands you can run. The commands will automatically download and install the plugin if it hasn’t already been installed. List goals by the order they will execute > mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list PLUGIN | PHASE | ID | GOAL … Read more

How to build a jar using maven, ignoring test results? [duplicate]

Please refer to surefire:test for details, but the most useful properties are: -Dmaven.test.failure.ignore=true (or -DtestFailureIgnore=true) – will ignore any failures occurred during test execution -Dmaven.test.error.ignore=true ( deprecated ) – will ignore any errors occurred during test execution -DskipTests – would compile the test classes but skip test execution entirely -Dmaven.test.skip=true – would not even compile … Read more

I want to execute shell commands from Maven’s pom.xml

Here’s what’s been working for me: <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <executions> <execution><!– Run our version calculation script –> <id>Version Calculation</id> <phase>generate-sources</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${basedir}/scripts/calculate-version.sh</executable> </configuration> </execution> </executions> </plugin>

How to specify maven’s distributionManagement organisation wide?

The best solution for this is to create a simple parent pom file project (with packaging ‘pom’) generically for all projects from your organization. <?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>your.company</groupId> <artifactId>company-parent</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>pom</packaging> <distributionManagement> <repository> <id>nexus-site</id> <url>http://central_nexus/server</url> </repository> </distributionManagement> </project> This can be built, released, and deployed to your local nexus … Read more

Git Ignores and Maven targets

The .gitignore file in the root directory does apply to all subdirectories. Mine looks like this: .classpath .project .settings/ target/ This is in a multi-module maven project. All the submodules are imported as individual eclipse projects using m2eclipse. I have no further .gitignore files. Indeed, if you look in the gitignore man page: Patterns read … Read more

Building executable jar with maven?

Actually, I think that the answer given in the question you mentioned is just wrong (UPDATE – 20101106: someone fixed it, this answer refers to the version preceding the edit) and this explains, at least partially, why you run into troubles. It generates two jar files in logmanager/target: logmanager-0.1.0.jar, and logmanager-0.1.0-jar-with-dependencies.jar. The first one is … Read more

A simple command line to download a remote maven2 artifact to the local repository?

Since version 2.1 of the Maven Dependency Plugin, there is a dependency:get goal for this purpose. To make sure you are using the right version of the plugin, you’ll need to use the “fully qualified name”: mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \ -DrepoUrl=http://download.java.net/maven/2/ \ -Dartifact=robo-guice:robo-guice:0.4-SNAPSHOT

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)