Maven profile activation with multiple conditions

Maven <activation> block is a list of OR — the profile will be activated as soon as the first criteria is met. So, it is less likely that your problem has a solution at least until this bug-report gets fixed https://issues.apache.org/jira/browse/MNG-4565 Update: it’s fixed in 3.2.2 now – sfussenegger (via comment)

maven report on licenses your project depends on [closed]

The Maven Project Info Reports Plugin can be used to generate a Project Dependencies report that lists all dependencies and also groups them by licenses. The project-info-reports:dependencies goal can be used to generate an individual report but it should be used as a Maven report and is actually provided by default (see Configuring Reports) when … Read more

Adding the current date with Maven2 filtering

Feature does not work with maven 2.2.1 resource filtering. See: https://issues.apache.org/jira/browse/MRESOURCES-99 But you could create a custom property in the parent pom: <properties> <maven.build.timestamp.format>yyMMdd_HHmm</maven.build.timestamp.format> <buildNumber>${maven.build.timestamp}</buildNumber> </properties> Where buildNumber is the new property that can be filtered into the resources.

Using the Nexus rest API to get latest artifact version for given groupid/artifactId

The following URL will retrieve the latest version of log4j 1.2.x: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST Documented here Update Example using curl: curl -L “http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST” -o log4j.jar Update for Log4j2 Log4j 1.2 is EOL since summer 2015 and is known to be broken in Java 9. Here is the link for the Log4j artifacts: log4j-api: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-api&v=LATEST log4j-core: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-core&v=LATEST

Maven – Add directory to classpath while executing tests

You can also add new test resource folders. <build> <testResources> <testResource> <directory>${project.basedir}/src/test/resources</directory> </testResource> <testResource> <directory>${project.basedir}/src/test/something_else</directory> </testResource> </testResources> </build> The first path, src/test/resources, is the default. Assuming you still want the default path to be used, make sure it’s included. (The testResources tag overwrites your defaults, so if you don’t include the default path explicitly, it … Read more

Using Maven for multiple deployment environment (production/development)

FYI best practice is to not have to rebuild your artifact for different environments – as that does not lead to re-produce-able builds, and other things could potentially change when rebuilding. I.e. using resource-filtering, as suggested above, only works when re-building your project. When you graduate an artifact from dev to test or acceptance test … Read more

how to release a project which depends on a 3rd party SNAPSHOT project in maven

Problem is with the allowTimestampedSnapshots parameter name, it’s in the documentation but the plugin’s source uses a different parameter name in expression – ignoreSnapshots. So just use -DignoreSnapshots=true and the prepare goal of the release plugin will ignore snapshot dependencies.

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