Disable a Maven plugin defined in a parent POM

The following works for me when disabling Findbugs in a child POM: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <executions> <execution> <id>ID_AS_IN_PARENT</id> <!– id is necessary sometimes –> <phase>none</phase> </execution> </executions> </plugin> Note: the full definition of the Findbugs plugin is in our parent/super POM, so it’ll inherit the version and so-on. In Maven 3, you’ll need to use: … Read more

Importing Maven project into Eclipse

I want to import existing maven project into eclipse. I found 2 ways to do it, one is through running from command line mvn eclipse:eclipse and another is to install maven eclipse plugin from eclipse. What is the difference between the both and which one is preferable? The maven-eclipse-plugin is a Maven plugin and has … Read more

Get Maven artifact version at runtime

You should not need to access Maven-specific files to get the version information of any given library/class. You can simply use getClass().getPackage().getImplementationVersion() to get the version information that is stored in a .jar-files MANIFEST.MF. Luckily Maven is smart enough Unfortunately Maven does not write the correct information to the manifest as well by default! Instead … Read more

How do I get my Maven Integration tests to run

The Maven build lifecycle now includes the “integration-test” phase for running integration tests, which are run separately from the unit tests run during the “test” phase. It runs after “package”, so if you run “mvn verify”, “mvn install”, or “mvn deploy”, integration tests will be run along the way. By default, integration-test runs test classes … Read more

Maven check for updated dependencies in repository

The Maven Versions plugin and it’s display-dependency-updates mojo are what you’re looking for: mvn versions:display-dependency-updates Here is what the output looks like: [INFO] ———————————————————————— [INFO] Building Build Helper Maven Plugin [INFO] task-segment: [versions:display-dependency-updates] [INFO] ———————————————————————— [INFO] [versions:display-dependency-updates] [INFO] [INFO] The following dependency updates are available: [INFO] org.apache.maven:maven-artifact …………………… 2.0 -> 2.0.9 [INFO] org.apache.maven:maven-plugin-api …………………. 2.0 … Read more

Sharing Test code in Maven

I recommend using type instead of classifier (see also: classifier). It tells Maven a bit more explicitly what you are doing (and I’ve found that m2eclipse and q4e both like it better). <dependency> <groupId>com.myco.app</groupId> <artifactId>foo</artifactId> <version>1.0-SNAPSHOT</version> <type>test-jar</type> <scope>test</scope> </dependency>

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