JUnit tests pass in Eclipse but fail in Maven Surefire

I had the same problem (JUnit tests failed in Maven Surefire but passed in Eclipse) and managed to solve it by setting forkMode to always in the maven surefire configuration in pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12</version> <configuration> <forkMode>always</forkMode> </configuration> </plugin> Surefire parameters: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html Edit (January 2014): As Peter Perháč pointed out, the forkMode parameter is … Read more

List all of the possible goals in Maven 2?

The goal you indicate in the command line is linked to the lifecycle of Maven. For example, the build lifecycle (you also have the clean and site lifecycles which are different) is composed of the following phases: validate: validate the project is correct and all necessary information is available. compile: compile the source code of … Read more

Should we use Nexus or Artifactory for a Maven Repo? [closed]

I’m sure that if you only talk about storing binaries from “mvn deploy” both will do fine. We use Artifactory very extensively with all upgrades along the way. Lots of projects, numerous snapshots deployed and external repos proxied. Not a single problem. I find it hard to explain how other people experience issues with its … Read more

Is it possible to override the configuration of a plugin already defined for a profile in a parent POM?

Overriding configurations from a parent pom can be done by adding the combine.self=”override” attribute to the element in your pom. Try changing your plugin configuration to: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <id>my-testCompile</id> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> <configuration combine.self=”override”> <fork>true</fork> <executable>${jdk15.executable}</executable> <compilerVersion>1.5</compilerVersion> <source>1.5</source> <target>1.5</target> <verbose>true</verbose> </configuration> </execution> </executions> </plugin> For more information on overriding plugins, see: … Read more

In Maven 2, how do I know from which dependency comes a transitive dependency?

To add to @David Crow, here’s a dependency:tree example from the Maven site: mvn dependency:tree -Dincludes=velocity:velocity might output [INFO] [dependency:tree] [INFO] org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:2.0-alpha-5-SNAPSHOT [INFO] \- org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-8:compile [INFO] \- org.codehaus.plexus:plexus-velocity:jar:1.1.3:compile [INFO] \- velocity:velocity:jar:1.4:compile

Missing Maven dependencies in Eclipse project

Well, I tried everything posted here, unfortunately nothings works in my case. So, trying different combinations I came out with this one that solved my problem. 1) Open the .classpath file at the root of your eclipse’s project. 2) Insert the following entry to the file: <classpathentry kind=”con” path=”org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER”> <attributes> <attribute name=”maven.pomderived” value=”true”/> <attribute name=”org.eclipse.jst.component.nondependency” … Read more

Maven2 property that indicates the parent directory

Try setting a property in each pom to find the main project directory. In the parent: <properties> <main.basedir>${project.basedir}</main.basedir> </properties> In the children: <properties> <main.basedir>${project.parent.basedir}</main.basedir> </properties> In the grandchildren: <properties> <main.basedir>${project.parent.parent.basedir}</main.basedir> </properties>

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