Maven best practice for generating multiple jars with different/filtered classes?

The Maven general rule is “one primary artifact per POM” for the sake of modularity and the reasons one shouldn’t break this convention (in general) are very well explained in the How to Create Two JARs from One Project (…and why you shouldn’t) blog post. There are however justified exceptions (for example an EJB project … Read more

Logging level under maven surefire

I tried setting java.util.logging.config.file in the MAVEN_OPTS environment variable, which does not work but finally got it working by putting that system property in the pom.xml (and of course creating an appropriate logging.properties in src/test/resources): <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>java.util.logging.config.file</name> <value>src/test/resources/logging.properties</value> </property> </systemProperties> </configuration> </plugin> </plugins>

maven-assembly plugin – how to create nested assemblies

With your existing configuration, your two separate configurations for the assembly plugin will be merged, and the configurations will also be merged. To achieve your goal you should define a single assembly-plugin configuration with multiple nested executions, then define the configuration for each execution inside it. The assembly plugin will then execute each assembly sequentially, … Read more

Which Maven GlassFish plugin to use?

Update: CARGO-491 has been fixed and I’ve updated my answer accordingly. To summarize, there are now basically three options: Maven GlassFish Plugin A first option would be to use the Maven GlassFish Plugin. This plugin allows to interact with a local or remote GlassFish install and the management of Glassfish domains and component deployments from … Read more

Different maven compiler versions for test and main

If you want to set compliance to the relevant Java version, you can configure the compiler plugin for each execution. Assuming Maven is using a JDK at least as current as the highest version you specify. By using properties you can override that configuration on the commandline or in a child if needed: <plugin> <groupId>org.apache.maven.plugins</groupId> … Read more

java.net maven repo – JMS artifact missing

Realizing that the Sun’s JARs are not on Maven central due to licensing issues, I added the following Maven repo to my POM Yeah, but http://download.java.net/maven/2/javax/ doesn’t have the jms artifact… The good news is that the JBoss Nexus repository does have it: <repository> <id>repository.jboss.org-public</id> <name>JBoss repository</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> </repository>

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