Share test resources between maven projects

Just use jar:test-jar and declare the resulting JAR as a dependency (refer to this guide for more details). And while I don’t understand the problem of having resources and classes in this jar, you can always exclude all .class files: <project> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> <configuration> … Read more

When to use MojoExecutionException vs MojoFailureException in Maven

It seems you should throw a MojoExecutionException if the problem makes it impossible to continue with the build, and use the MojoFailureException otherwise. You can control the behavior for handing MojoFailureExpections when maven is run. The following link details the difference: https://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html#writing-plugins-sect-failure Broken link? Google search sonatype writing-plugins-sect-custom-plugin writing-plugins-sect-failure

Maven: Packaging dependencies alongside project JAR?

I’ve like Maven to package a project with run-time dependencies. This part is unclear (it’s not exactly what you describe just after). My answer covers what you described. I expect it to create a JAR file with the following manifest (…) Configure the Maven Jar Plugin to do so (or more precisely, the Maven Archiver): … Read more

In maven, what is the difference between main/resources and main/config?

The email exchange at http://www.mail-archive.com/users@maven.apache.org/msg90985.html says: “This is all theory… Perhaps while writing the docs, someone involved with Maven development thought it might be useful to have a src/main/config directory and so it was included in docs, but since it was never implemented in the code, it is not being used today.“ and “The directory … Read more

Maven – how to delete contents of a folder during a clean phase?

Add this includes section to your fileset definition <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>war</directory> <includes> <include>**/*</include> </includes> <followSymlinks>false</followSymlinks> </fileset> </filesets> </configuration> </plugin> </plugins> </build>

maven2: excluding directory from WAR

Both of your solutions wouldn’t help, as they would add an additional resource that is then deactivated. The webapp source folder is copied by default, without the resource mechanism. The mechanism to deactivate a part of that is through the <warSourceExcludes> parameter, like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1</version> <configuration> <warSourceExcludes>webscripts/**</warSourceExcludes> </configuration> </plugin>

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