maven checkstyle plugin and guava / google-collections dependency clash - maven

In our multiple module maven (3) project we are utilising the maven checkstyle plugin. It looks like that since we've shifted the guava dependency to our parent pom, we can't execute successfully the checkstyle:checkstyle goal anymore, because it fails with the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-
plugin:2.10:checkstyle (default-cli) on project init: Execution default-cli of goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.10:checkstyle failed: An API
incompatibility was encountered while executing org.apache.maven.plugins:maven-
checkstyle-plugin:2.10:checkstyle: java.lang.NoSuchMethodError:
com.google.common.collect.ImmutableSortedSet.of([Ljava/lang/Comparable;)Lcom/google
/common/collect/ImmutableSortedSet;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.10
The reason might be that the maven checkstyle plugin depends on the checkstyle framework, which depends on the google-collections framework (that is nowadays included in the google guava framework), i.e., that checkstyle calls a method that is not part of google collections in guava anymore.
Here is an excerpt of the parent pom that were are utilising:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ourcompany.ourproject</groupId>
<artifactId>ourproject</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>our project</name>
<modules>
<module>init</module>
...
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.11</junit.version>
<maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.14</maven-surefire-plugin.version>
<maven-checkstyle-plugin.version>2.10</maven-checkstyle-plugin.version>
<maven-pmd-plugin.version>3.0.1</maven-pmd-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<java.source.version>1.6</java.source.version>
<java.target.version>1.6</java.target.version>
<google.guava.version>14.0.1</google.guava.version>
</properties>
<repositories>
<repository>
<id>nexus</id>
<name>Internal Maven Repository</name>
<url>http://ourinternalmavenrepository/nexus/content/groups/public</url>
</repository>
...
</repositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
<distributionManagement>
<repository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://ourinternalmavenrepository/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://ourinternalmavenrepository/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<profiles>
...
<profile>
<id>metrics</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<!-- CHECKSTYLE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<configuration>
<configLocation>our_checkstyle.xml</configLocation>
<failsOnError>false</failsOnError>
<consoleOutput>true</consoleOutput>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
</configuration>
<dependencies>
<dependency>
<groupId>com.ourcompany.ourproject</groupId>
<artifactId>init</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<failsOnError>false</failsOnError>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<configuration>
<configLocation>our_checkstyle.xml</configLocation>
<targetJdk>${java.source.version}</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<targetJdk>${java.source.version}</targetJdk>
</configuration>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
<!-- <dependencyManagement> -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
...
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${google.guava.version}</version>
</dependency>
...
</dependencies>
<!-- </dependencyManagement> -->
I think that utilising the maven checkstyle plugin in a maven project is very common as well as utilising the guava framework. So I'm really wondering what we are doing wrong here ;)

Thanks a lot #AndrewLogvinov. He prodivded the working solution in his comment to this question. One just needs to add the google-collections dependency to the dependencies of the maven-checkstyle-plugin:
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0</version>
</dependency>

Related

Building a spring boot azure function with pipeline fails with following error: Failed to get Azure Functions Core Tools version locally

I am relatively new to azure functions and I am trying to create an azure function in java using spring boot that is triggered by an azure event hub message.
I used an example I found here and changed the relevant code from HTTP trigger to event hub trigger.
Building it locally and deploying it to azure via the maven plugin works without any issues but soon as I try to have this code built by an azure pipeline I get the following error:
[INFO] Step 8 of 8: Installing function extensions if needed
[WARNING] Failed to get Azure Functions Core Tools version locally
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:17 min
[INFO] Finished at: 2022-06-25T13:39:48Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.microsoft.***:***-functions-maven-plugin:1.14.2:package (package-functions) on project cutcloud-token-service: Local Azure Functions Core Tools does not exist or is too old to support function extension installation, skip package phase. To install or update it, see: https://aka.ms/azfunc-install -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The process '/usr/bin/mvn' failed with exit code 1
my pipeline code:
trigger:
branches:
include:
- master
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: MavenAuthenticate#0
inputs:
mavenServiceConnections: 'nexus'
- task: Maven#3
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: 11
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
goals: clean package
and here is the pom.xml mostly like in the example with some additional libraries needed by my business logic:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>hello</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Hello Spring Function on Azure</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<azure.functions.java.library.version>2.0.0</azure.functions.java.library.version>
<azure.functions.maven.plugin.version>1.17.0</azure.functions.maven.plugin.version>
<!-- customize those two properties. The functionAppName should be unique across Azure -->
<functionResourceGroup>my-spring-function-resource-group</functionResourceGroup>
<functionAppName>my-spring-function</functionAppName>
<functionAppRegion>westeurope</functionAppRegion>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.example.DemoApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-azure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-function-webflux</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-service-client</artifactId>
<version>1.33.2</version>
</dependency>
<dependency>
<groupId>de.digital.asap.cloud</groupId>
<artifactId>cloud-messages</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>net.gsadev.crypto</groupId>
<artifactId>crypto-lib</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>3.7.6</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-dependencies</artifactId>
<version>3.2.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>4.1.5</version>
<configuration>
<includes>
<include>com.example.loadtest.*</include>
</includes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<configuration>
<resourceGroup>${functionResourceGroup}</resourceGroup>
<appName>${functionAppName}</appName>
<region>${functionAppRegion}</region>
<runtime>
<os>linux</os>
<javaVersion>11</javaVersion>
</runtime>
<appSettings>
<!-- Run Azure Function from package file by default -->
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~4</value>
</property>
<property>
<name>FUNCTIONS_WORKER_RUNTIME</name>
<value>java</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>
${project.build.directory}/azure-functions/${functionAppName}
</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/azure
</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${stagingDirectory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<!--Remove obj folder generated by .NET SDK in maven clean-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>gsadev.nexus</id>
<name>Internal GSIDEV Repository</name>
<url>https://nexus.gsadev.net/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
What I found strange is that the error does not ocurre if I simply remove the event hub annotation from the trigger method without doing any other changes to the code and/or pom:
#FunctionName("createAndSendToken")
public void run(
// #EventHubTrigger(name = "apiTokenRequests",
// eventHubName = "api-key-requests",
// connection = "EventhubConnectionString",
// consumerGroup = "digiapp",
// cardinality = Cardinality.ONE)
String payload,
final ExecutionContext context
) {
context.getLogger().info("EventHub trigger function execution started");
context.getLogger().info("payload:" + payload);
KeyResponse keyResponse = handleRequest(new KeyRequest(payload), context);
context.getLogger().info("EventHub trigger function execution finished with status " + keyResponse.getStatus());
}
Even more strange: I have an earlier version of the function derieved from an other example (which I don't find any more) that is not using spring.
Here the code with the eventhub trigger can be build by an azure pipeline without any issues.
the pom for that function looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.digital.asap.azure</groupId>
<artifactId>cutcloud-token-service</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Cutcloud Token Service</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<azure.functions.maven.plugin.version>1.14.2</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<functionAppName>cutcloud-token-service</functionAppName>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
</properties>
<repositories>
<repository>
<id>gsadev.nexus</id>
<name>Internal GSADEV Repository</name>
<url>https://nexus.gsadev.net/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.microsoft.azure</groupId>-->
<!-- <artifactId>applicationinsights-core</artifactId>-->
<!-- <version>2.6.3</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-service-client</artifactId>
<version>1.33.2</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.5</version>
</dependency>
<dependency>
<groupId>net.gsadev.crypto</groupId>
<artifactId>crypto-lib</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>de.digital.asab.cloud</groupId>
<artifactId>cloud-messages</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<optional>true</optional>
</dependency>
<!-- <dependency>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- <artifactId>logback-core</artifactId>-->
<!-- <version>1.2.7</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- <artifactId>logback-classic</artifactId>-->
<!-- <version>1.2.7</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- <version>1.7.32</version>-->
<!-- </dependency>-->
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
<appName>${functionAppName}</appName>
<resourceGroup>gsadev-sandbox</resourceGroup>
<appServicePlanName>TestServicePlan</appServicePlanName>
<region>westeurope</region>
<!-- function pricingTier, default to be consumption if not specified -->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-pricing-tiers for all valid values -->
<!-- <pricingTier></pricingTier> -->
<disableAppInsights>false</disableAppInsights>
<runtime>
<!-- runtime os, could be windows, linux or docker-->
<os>linux</os>
<javaVersion>8</javaVersion>
<!-- for docker function, please set the following parameters -->
<!-- <image>[hub-user/]repo-name[:tag]</image> -->
<!-- <serverId></serverId> -->
<!-- <registryUrl></registryUrl> -->
</runtime>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~3</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${stagingDirectory}</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>host.json</include>
<include>local.settings.json</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${stagingDirectory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
<excludeArtifactIds>azure-functions-java-library</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<!--Remove obj folder generated by .NET SDK in maven clean-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
The code and annotation for the older function trigger is the same as in the new code that can't be built for some reason.
I already tried different things like changing the version of the maven plugin, the azure libraries, the function version, and the extension bundle versions. etc.
I also tried different build/agent images:
pool:
vmImage: 'ubuntu-latest'
and
pool:
vmImage: 'ubuntu-22.04'
but nothing helped. I am out of ideas. Can anyone help, please?
regards
Christian
Because of the reasons mentioned above, I am still not convinced that this is the best solution but following the comment of #khmarbaise, I fixed my problem by installing the necessary tools manually into the build agent before calling the actual build step:
- task: Npm#1
inputs:
#this is needed so that the function extension install in the maven task doesn't fail
command: 'custom'
customCommand: 'install -g azure-functions-core-tools#3 --unsafe-perm true'

Cannot read settings.xml after spring upgrade from 1.2.8.RELEASE to 1.3.8.RELEASE

After upgrading the Spring parent POM application from 1.2.8.RELEASE to 1.3.8.RELEASE I noticed that properties defined in settings.xml could not be read. Does spring does not support reading from settings.xml in versions higher than 1.2.8.RELEASE.
Code is available on GIT at : https://github.com/Ravivyas1989/demo
Here is the example of code snippet for my problem POM.xml:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<repositories>
<repository>
<id>spring-release</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>atlassian-public</id>
<url>https://maven.atlassian.com/repository/public</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
<repository>
<id>jr-ce-snapshots</id>
<name>JasperReports CE Snapshots</name>
<url>http://jaspersoft.jfrog.io/jaspersoft/jr-ce-snapshots</url>
</repository>
<repository>
<id>redshift</id>
<url>http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release</url>
</repository>
<repository>
<id>project-repo</id>
<url>file:${project.basedir}/src/main/resources/repo/</url>
</repository>
<repository>
<id>jcenter-release</id>
<name>jcenter</name>
<url>http://jasperreports.sourceforge.net/maven2/</url>
</repository>
<!-- bouncy-gpg Bouncy Castle with GPG -->
<repository>
<id>bintray</id>
<name>bintray</name>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
<build>
<finalName>api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<!-- Always download and attach dependencies source code -->
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<!-- To create project run: mvn eclipse:eclipse -->
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<!-- specify UTF-8, ISO-8859-1 or any other file encoding -->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Duser.timezone=US/Eastern ${argLine}</argLine>
<!--<systemProperties>
<property>
<name>createJsonFiles</name>
<value>${createJsonFiles}</value>
</property>
</systemProperties>-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19</version><!--$NO-MVN-MAN-VER$ -->
<configuration>
<parallel>methods</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
<forkCount>1</forkCount>
<argLine>-Duser.timezone=US/Eastern</argLine>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<configuration>
<excludes>
<exclude>
**/reporting-functions/**
</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/reportTemplates</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/~$*.xlsx</exclude>
</excludes>
</resource>
</resources>
</build>
Here is DemoApplication.java
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Here is settings.xml:
<settings>
<servers>
<server>
<id>snapshots</id>
<username>${NEXUS_USERNAME}</username>
<password>${NEXUS_PASSWORD}</password>
</server>
<server>
<id>releases</id>
<username>${NEXUS_USERNAME}</username>
<password>${NEXUS_PASSWORD}</password>
</server>
<server>
<id>configs</id>
<username>${NEXUS_USERNAME}</username>
<password>${NEXUS_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>d02</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- General Database Properties -->
<db.userName>appservers</db.userName>
<db.password>appservers</db.password>
</properties>
</profile>
</profiles>
Testcontroller.java
package com.example.demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class TestController {
#Autowired
private Environment env;
#RequestMapping(method = RequestMethod.GET, value = "${db.user}")
public String testing1() {
System.out.println("db.user is "+env.getProperty("db.user"));
return "hostName";
}
}
application.properties
db.user=${db.userName}
platform=testlab
server.port=9090
"Notice the #property# instead of ${property}. in the application.properties file.
The spring-boot-starter-parent pom redefines the standard ${} delimiter as #:"
My question is answered here:
Cannot get maven project.version property in a Spring application with #Value
Maven always reads the properties from the settings.xml. There must be some other error.

Munit test are failing in Jenkins docker container

I was trying to run this pom.xml using the maven commands in my Jenkins docker container in my local. The build fails every time and returns me this error
Failed to execute goal
com.mulesoft.munit.tools:munit-maven-plugin:2.1.4:test (test) on
project ms3-sample-api: Build Fail: Error: Could not find or load main
class org.mule.munit.remote.RemoteRunner
And if I skip the tests the build is successful and this code even works in my remote but not on my local. Any suggestions and concerns on this. Thanks in advance
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>ms3-sample-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>ms3-sample-api</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.1.4</app.runtime>
<mule.maven.plugin.version>3.1.6</mule.maven.plugin.version>
<munit.version>2.1.4</munit.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<classifier>mule-application</classifier>
</configuration>
</plugin>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<version>${munit.version}</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
<goal>coverage-report</goal>
</goals>
</execution>
</executions>
<configuration>
<coverage>
<runCoverage>true</runCoverage>
<requiredApplicationCoverage>0</requiredApplicationCoverage>
<requiredResourceCoverage>0</requiredResourceCoverage>
<requiredFlowCoverage>0</requiredFlowCoverage>
<formats>
<format>html</format>
<format>console</format>
<format>json</format>
</formats>
</coverage>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/munit</directory>
</testResource>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/main/mule</directory>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.3.2</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.1.2</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-apikit-module</artifactId>
<version>1.1.9</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-runner</artifactId>
<version>2.1.4</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-tools</artifactId>
<version>2.1.4</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange</id>
<name>Anypoint Exchange</name>
<url>https://maven.anypoint.mulesoft.com/api/v1/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-releases</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
This can be resolved when we look into the container we need to install java manually and set their paths in jenkins->config tools. It worked fine for me

Skip compilation of integration test in maven project

How do I skip the compilation of integration tests when installing a maven project?
I only found -DskipITs and -DskipTests but they only skip the execution, not the compilation.
I would like to remove the needed test dependencies.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.example.confluence</groupId>
<artifactId>qspaRest</artifactId>
<packaging>atlassian-plugin</packaging>
<name>qspaRest</name>
<version>3.0.4-SNAPSHOT</version>
<description>REST resources needed by the QSPA backend importer for
* getting meta information from a space (name, description, homepage, permissions, ...)</description>
<build>
<sourceDirectory>/Users/example/git/qsparest/qsparest/src/main/java</sourceDirectory>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>/Users/example/git/qsparest/qsparest/src/test/java</testSourceDirectory>
<outputDirectory>/Users/example/git/qsparest/qsparest/target/classes</outputDirectory>
<testOutputDirectory>/Users/example/git/qsparest/qsparest/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>/Users/example/git/qsparest/qsparest/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>/Users/example/git/qsparest/qsparest/src/test/resources</directory>
</testResource>
</testResources>
<directory>/Users/example/git/qsparest/qsparest/target</directory>
<!-- <finalName>qspaRest-3.0.3-SNAPSHOT</finalName>-->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</plugin>
<!-- For install:install-file-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-rar-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-8</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-7</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.0.4</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<!-- delete directories that will be generated when you
start the develpment server/client in eclipse
-->
<fileset>
<directory>target</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-confluence-plugin</artifactId>
<version>3.9</version>
<extensions>true</extensions>
<configuration>
<allowGoogleTracking>false</allowGoogleTracking>
<productVersion>${confluence.version}</productVersion>
<productDataVersion>3.5</productDataVersion>
<productDataPath>${basedir}/src/test/resources/generated-test-resources.zip</productDataPath>
<instructions />
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<releases>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<id>atlassian-public</id>
<url>https://m2proxy.atlassian.com/repository/public</url>
</repository>
<repository>
<releases>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>atlassian-plugin-sdk</id>
<url>file:///Users/example/Desktop/atlassian-plugin-sdk-3.9/repository</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<id>atlassian-public</id>
<url>https://m2proxy.atlassian.com/repository/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.confluence.plugin</groupId>
<artifactId>func-test</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
<version>${confluence.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.wink</groupId>
<artifactId>wink-client</artifactId>
<version>1.1.3-incubating</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<!--
<dependency>
<groupId>de.example</groupId>
<artifactId>qspaBackend</artifactId>
<version>3.0.3-SNAPSHOT</version>
</dependency>
-->
<!-- TODO: There is no separate confluence artifact, so we depend on the complete backend at the moment
-->
<dependency>
<groupId>de.example</groupId>
<artifactId>qspaJiraModel</artifactId>
<version>3.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.example</groupId>
<artifactId>qspaConfluenceModel</artifactId>
<version>3.0.4-SNAPSHOT</version>
</dependency>
<!--
-->
</dependencies>
<reporting>
<outputDirectory>/Users/example/git/qsparest/qsparest/target/site</outputDirectory>
</reporting>
<properties>
<amps.version>3.9</amps.version>
<downloadSources>true</downloadSources>
<confluence.data.version>3.5</confluence.data.version>
<downloadJavadocs>true</downloadJavadocs>
<confluence.version>4.1.4</confluence.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>true</skipTests>
<!-- Settings for install:install-file-->
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<packaging>${project.packaging}</packaging>
<file>${project.build.directory}/${project.build.finalName}.jar</file>
</properties>
</project>
The property -Dmaven.test.skip=true will skip all tests and also all test compilation, because it is accepted by the failsafe, surefire and compiler plugin. All other properties like -DskipTests will only skip the execution of the tests but the files are still compiled.

Unknown package: mule-module error after running mvn archetype for cloud connector creation via DevKit

i've created a new Cloud Connector using DevKit, after running:
mvn clean package -Ddevkit.studio.package.skip=false
The project shows errors in the pom.file:
Project build error: Unknown packaging: mule-module pom.xml /http-https-component
And:
Project build error: Unresolveable build extension: Plugin org.mule.tools.devkit:mule-devkit-maven-plugin:3.4.0 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.6 at specified path C:\Program Files\Java\jre6/../lib/tools.jar pom.xml /http-https-component
This is my entire current pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mulesoft</groupId>
<artifactId>http-https-component</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>mule-module</packaging>
<name>Mule Cloud Connector</name>
<properties>
<mule.version>3.4.0</mule.version>
<mule.devkit.version>3.4.0</mule.devkit.version>
<junit.version>4.9</junit.version>
<mockito.version>1.8.2</mockito.version>
<jdk.version>1.6</jdk.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.mule.tools.devkit</groupId>
<artifactId>mule-devkit-maven-plugin</artifactId>
<version>${mule.devkit.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.mule.tools.devkit</groupId>
<artifactId>mule-devkit-maven-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>attach-test-resources</goal>
<goal>filter-resources</goal>
<goal>generate-sources</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mule.tools.devkit</groupId>
<artifactId>mule-devkit-maven-plugin</artifactId>
<version>${mule.devkit.version}</version>
</plugin><plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludePackageNames>org.mule.tooling.ui.contribution:*</excludePackageNames>
<docletArtifact>
<groupId>org.mule.tools.devkit</groupId>
<artifactId>mule-devkit-doclet</artifactId>
<version>${mule.devkit.version}</version>
</docletArtifact>
<doclet>org.mule.devkit.doclet.Doclava</doclet>
<bootclasspath>${sun.boot.class.path}</bootclasspath>
<additionalparam>
-quiet
-federate JDK http://download.oracle.com/javase/6/docs/api/index.html?
-federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml
-hdf project.artifactId "${project.artifactId}"
-hdf project.groupId "${project.groupId}"
-hdf project.version "${project.version}"
-hdf project.name "${project.name}"
-hdf project.repo.name "${project.distributionManagement.repository.name}"
-hdf project.repo.id "${project.distributionManagement.repository.id}"
-hdf project.repo.url "${project.distributionManagement.repository.url}"
-hdf project.snapshotRepo.name "${project.distributionManagement.snapshotRepository.name}"
-hdf project.snapshotRepo.id "${project.distributionManagement.snapshotRepository.id}"
-hdf project.snapshotRepo.url "${project.distributionManagement.snapshotRepository.url}"
-d ${project.build.directory}/apidocs
</additionalparam>
<useStandardDocletOptions>false</useStandardDocletOptions>
<additionalJOption>-J-Xmx1024m</additionalJOption>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-alpha-4</version>
<executions>
<execution>
<id>enforce-maven-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.0.0,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.6.0,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/test/resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-spring-config</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.tools.devkit</groupId>
<artifactId>mule-devkit-annotations</artifactId>
<version>${mule.devkit.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>eclipse-workbench</artifactId>
<version>3.6.1.M20100826-1330</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>eclipse-runtime</artifactId>
<version>3.6.0.v20100505</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>core</artifactId>
<version>4.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots</id>
<name>MuleSoft Snapshots Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>codehaus-releases</id>
<name>CodeHaus Releases</name>
<url>http://repository.codehaus.org/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-plugin-releases</id>
<name>MuleSoft Release Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>mulesoft-plugin-snapshots</id>
<name>MuleSoft Snapshot Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
This is part of my settings.xml in m2 folder:
<mirrors>
<mirror>
<id>mulesoft-release</id>
<mirrorOf>muleforge-release</mirrorOf>
<name>Mulesoft Release Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
</mirror>
<mirror>
<id>mulesoft-snapshot</id>
<mirrorOf>muleforge-snapshot</mirrorOf>
<name>Mulesoft Snapshot Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
</mirror>
<mirror>
Thanks in advance.
The packaging is mule not mule-module.
EDIT: Also make sure you have org.mule.tools in your settings.xml pluginGroups:
<pluginGroups>
<pluginGroup>org.mule.tools</pluginGroup>
...
</pluginGroups>
change AnypointStudio's Default JRE to jdk->jre, For example:
old:C:\Program Files\Java\jre7
new:C:\Program Files\Java\jdk1.7.0_71\jre
Use this:
<plugin>
<groupId>org.mule.tools</groupId>
<artifactId>maven-mule-plugin</artifactId>
<version>1.9</version>
<extensions>true</extensions>
<configuration>
<excludeMuleDependencies>false</excludeMuleDependencies>
<copyToAppsDirectory>true</copyToAppsDirectory>
<inclusions>
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-requester</artifactId>
</inclusion>
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-requester</artifactId>
</inclusion>
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
</inclusion>
</inclusions>
</configuration>
</plugin>

Resources