Maven compile with multiple src directories

You can add a new source directory with build-helper: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>src/main/generated</source> </sources> </configuration> </execution> </executions> </plugin> </plugins> </build>

What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn’t?

The m2eclipse plugin doesn’t use Eclipse defaults, the m2eclipse plugin derives the settings from the POM. So if you want a Maven project to be configured to use Java 1.6 settings when imported under Eclipse, configure the maven-compiler-plugin appropriately, as I already suggested: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> If your project … Read more

Controlling Maven final name of jar artifact

For Maven >= 3 <packaging>jar</packaging> <build> <finalName>WhatEverYouLikey</finalName> </build> See bug report/documentation. (Credits to Matthew’s and his comment) For older Maven versions You set the finalName property in the plugin configuration section: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> <configuration> <finalName>myJar</finalName> </configuration> </plugin> As indicated in the official documentation.

How to get a dependency tree for an artifact?

1) Use maven dependency plugin Create a simple project with pom.xml only. Add your dependency and run: mvn dependency:tree (Version for multi-module Maven project: mvn compile dependency:tree ) Unfortunately dependency mojo must use pom.xml or you get following error: Cannot execute mojo: tree. It requires a project with an existing pom.xml, but the build is … Read more

How to get Maven project version to the bash command line

The Maven Help Plugin is somehow already proposing something for this: help:evaluate evaluates Maven expressions given by the user in an interactive mode. Here is how you would invoke it on the command line to get the ${project.version}: mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate \ -Dexpression=project.version As noted in the comments by Seb T, to only print the version … Read more

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