using maven in linux - linux

I'm using Maven3 in Linux (CentOs 5.x)
And run linux) mvn install -Preal
But following error occurs.
Here's error messages
...
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[36,51] package org.springframework.beans.factory.annotation does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[37,51] package org.springframework.beans.factory.annotation does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[38,37] package org.springframework.orm.ibatis does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[39,48] package org.springframework.security.core.context does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[40,52] package org.springframework.security.core.userdetails does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[41,37] package org.springframework.stereotype does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[42,49] package org.springframework.transaction.annotation does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[43,40] package org.springframework.web.multipart does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[44,40] package org.springframework.web.multipart does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[56,24] package com.sun.mail.smtp does not exist
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[58,1] cannot find symbol
[ERROR] symbol: class Service
[ERROR] #Service
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[59,1] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] #Transactional
[ERROR] /data/byto_openapi/src/main/java/com/byto/openapi/home/HomeServiceImpl.java:[64,9] cannot find symbol
...
And this is CLASSPATH
declare -x CLASSPATH=".:/usr/java/jdk/lib/tools.jar:/usr/local/tomcat/lib:/usr/local/tomcat/lib/servlet-api.jar:/usr/local/tomcat/lib/mysql-connector-java-5.1.17-bin.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/classes:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/bcprov-jdk16-146.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/bcprov-ext-jdk16-146.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/commons-lang-2.6.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/javapns-jdk16-161.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/log4j-1.2.16.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib:/data/byto_openapi/src/main/webapp/WEB-INF/lib/aspectjweaver-1.6.8.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/jstl-1.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/cglib-2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/tiles-template-2.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-digester-2.0.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/bcprov-ext-jdk16-146.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-fileupload-1.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/log4j-1.2.14.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-lang-2.1.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-config-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/ibatis-sqlmap-2.3.4.726.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-orm-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-ldap-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-lang-2.6.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-pool-1.3.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-beanutils-1.8.0.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-core-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-dbcp-1.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/tiles-api-2.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-tx-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/mail.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/aspectjrt-1.6.9.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-test-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.5.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/derbyclient-10.4.2.0.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-asm-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-context-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-jdbc-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-acl-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/javapns-jdk16-161.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-webmvc-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/asm-3.1.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/slf4j-api-1.5.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/jcl-over-slf4j-1.5.10.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-web-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-context-support-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-core-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/commons-io-1.3.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/activation.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/jackson-mapper-asl-1.9.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/tiles-servlet-2.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-aop-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/mysql-connector-java-5.1.19-bin.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-ldap-core-1.3.0.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-expression-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-beans-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/cos.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/tiles-jsp-2.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/org.springframework.roo.annotations-1.0.2.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/tiles-core-2.2.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/jackson-core-asl-1.9.2.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/junit-4.7.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-security-taglibs-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/spring-web-3.0.5.RELEASE.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/bcprov-jdk16-146.jar:/data/byto_openapi/src/main/webapp/WEB-INF/lib/javax.inject-1.jar"
As you can see all the JARs are included in CLASSPATH..
pom.xml
<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>cyoz</groupId>
<artifactId>cyoz</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<database.defaultAutoCommit>true</database.defaultAutoCommit>
<database.validationQuery>select 1</database.validationQuery>
<database.testWhileIdle>true</database.testWhileIdle>
<database.timeBetweenEvictionRunsMillis>7200000</database.timeBetweenEvictionRunsMillis>
<spring.version>3.0.5.RELEASE</spring.version>
<tiles.version>2.2.2</tiles.version>
<image.path>/data/api_svn_www/file/image</image.path>
</properties>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<scriptSourceDirectory>${basedir}/src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<targetPath>${basedir}/target/webapp</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<targetPath>${basedir}/target/classes</targetPath>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/src/test/resources</directory>
</testResource>
</testResources>
<filters>
<filter>${basedir}/src/main/resources/spring-common-bean-context.xml</filter>
<filter>${basedir}/src/main/resources/byto.cyoz.properties</filter>
</filters>
</build>
<profiles>
<profile>
<id>dev</id>
<properties>
<database.classname>me.kun.log4jdbc.DriverSpy</database.classname>
<database1.url>jdbc:log4jdbc:mysql://211.174.62.34:3306/bytoapi?autoReconnect=true</database1.url>
<database1.username>bytoapi</database1.username>
<database1.password>bytoapi1213</database1.password>
<database2.url>jdbc:log4jdbc:mysql://211.174.62.34:3306/byto_memo?autoReconnect=true</database2.url>
<database2.username>byto_memo</database2.username>
<database2.password>memo1213</database2.password>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warSourceDirectory>src/main/webapp/</warSourceDirectory>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<wtpversion>1.5</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-idea-plugin</artifactId>
<version>2.2</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<dependenciesAsLibraries>true</dependenciesAsLibraries>
<useFullNames>false</useFullNames>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<!--<encoding>EUC-KR</encoding> -->
</configuration>
</plugin>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<inherited>false</inherited>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<url>http://211.174.62.34:8080/manager/html</url>
<path>/cyoz</path>
<username>tomcat</username>
<password>tomcat</password>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>real</id>
<properties>
<database.classname>com.mysql.jdbc.Driver</database.classname>
<database1.url>jdbc:mysql://127.0.0.1:3306/bytoapi?autoReconnect=true</database1.url>
<database1.username>bytoapi</database1.username>
<database1.password>bytoapi1213</database1.password>
<database2.url>jdbc:mysql://127.0.0.1:3306/byto_memo?autoReconnect=true</database2.url>
<database2.username>byto_memo</database2.username>
<database2.password>memo1213</database2.password>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.2</version>
</dependency>
</dependencies>
linux /etc/profile which set CLASSPATH to compile *.java
# tomcat CLASSPATH
SOURCE_FOLDER=/data/byto_openapi
LIBRARY_FOLDER=$SOURCE_FOLDER/src/main/webapp/WEB-INF/lib
export CLASSPATH=$CLASSPATH:$LIBRARY_FOLDER
for file in `find $LIBRARY_FOLDER -name "*.jar" -type f`
do
export CLASSPATH=$CLASSPATH:$file
done

Maven does not look for the CLASSPATH variable to pick up its dependencies. Instead, it manages its own dependencies as specified in the pom.xml file. Indeed, this is the number one reason for using Maven in my book.
Have a look at Maven - Introduction to the Dependency Mechanism for a quick start to dependency management with Maven.
For inspecting the actual classpaths used by the Maven plugins run the build with the --debug argument, for instance
mvn --debug clean install -Preal

Related

No source TO compile maven-compiler-plugin:3.5.1:compile in Linux System

I am trying to run my selenium tessts from a linux system where Jenkins is configured . But On running the job i am getting No sources to compile message # maven-compiler-plugin:3.5.1:compile section .
Note : It is a Maven Project.
pom.xml contenet
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
Aspire_TA_Aspire_Generic_Framework_Java
GenericFramework_Java
1.0.0
jar
<name>Aspire TA Aspire Generic Framework - Java</name>
<url>http://repo.maven.apache.org/maven2</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<inherited>true</inherited>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- <systemPropertyVariables>
<url>${project.url}</url>
<site>${site}</site>
</systemPropertyVariables> -->
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<!-- To directly pointing the saucelabs repository -->
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!-- To directly pointing the soapui maven2 repository -->
<repository>
<id>smartbear-sweden-plugin-repository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</repository>
</repositories>
Below is my Directory structure
Linux is a case-sensitive OS by default, so you should rename the 'src/test/Java' folder to be 'src/test/java', and I don't see a 'src/main/java' folder so it has nothing to compile, or you should use the following configuration in your pom.xml file:
<build>
...
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/Java</testSourceDirectory>
...
</build>

linux maven vs mac maven

we are working in a multi-module maven project in both Linux machine and Mac machine with the same pom.xml, and we run the below command in offline mode
mvn install antrun:run -o
The problem is maven downloads a different version of plugins for the same pom.xml file. The difference is listed here comparison of Mac and Linux machine plugin jars
We did not specify the version of plugins in 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>Testing</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>Test</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>test.mac_linux</groupId>
<artifactId>Test</artifactId>
<version>1.0</version>
<file>${home_dir}/Downloads/jackson-databind-2.4.4.jar</file>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<configuration>
<phase>install</phase>
<target>
<zip destfile="${home_dir}/linux_mac_testing_maven/Testing_mac.zip">
<fileset dir="${home_dir}/.m2/repository/" includes="**/*" />
</zip>
</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources-WEB_INF</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${home_dir}/linux_mac_testing_maven/Resources/</outputDirectory>
<resources>
<resource>
<directory>${home_dir}/CustomReport_files/</directory>
<includes>
<include>**.*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
does anybody know why maven differs its characteristics when subjected to a different operating system?
You mention in https://jira.apache.org/jira/projects/MNG/issues/MNG-6470 you are using different versions of Maven (3.5 on Mac and 3.3.9 on Linux). Please update both to latest (3.5.4) and then compare results.

Maven Plugin for Azure Web Apps "<appServicePlanName>" not working

Created new project using latest Maven Azure Functions Archetype
mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype -DarchetypeVersion=1.11
I am using following tag in pom file.
<appServicePlanName>XXX2Plan</appServicePlanName>
Doc says : Specifies the name of the existing App Service Plan when you do not want to create a new one.
but after deployment its creating new APP SERVICE PLAN insted of using existing one, i am wonder if anyone solved it ?
<?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.khan.vaquar</groupId>
<artifactId>vaquar-khan-demo-azure-java-function</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Azure Java Functions</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<azure.functions.maven.plugin.version>1.0.0-beta-2</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.0.0-beta-4</azure.functions.java.library.version>
<functionAppName>vaquar-azure-java-function-demo</functionAppName>
<functionAppRegion>canadaeast</functionAppRegion>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<functionResourceGroup>XXXXXX</functionResourceGroup>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<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.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<configuration>
<resourceGroup>${functionResourceGroup}</resourceGroup>
<appServicePlanName>XXX2Plan</appServicePlanName>
<appName>${functionAppName}</appName>
<region>${functionAppRegion}</region>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>beta</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>
<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>
<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>
</plugins>
</build>
</project>
https://learn.microsoft.com/en-us/java/api/overview/azure/maven/azure-webapp-maven-plugin/readme
Workaround: First manually create function and then deploy using maven
insted of allow maven to create function for you.
Document you mentioned is for azure web app, while one for functions says only following properties are supported, including resourceGroup/appName/region/pricingTier/appSettings/deploymentType.
And we can see there's no code implementation about appServicePlanName in function plugin, while it is implemented in web app plugin.
So I assume for now it's not supported to deploy function app to existing app service plan using maven plugin.
And workaround is to create new function app on portal first, then deploy functions to this app with mvn plugin.
Update
Not supported indeed, see this issue.
Update2
This feature has been supported from 1.0.0-beta-3 azure-functions-maven-plugin.
Need to Add <appServicePlanName>existingplanname</appServicePlanName> under <properties>.

Maven equivalent of eclipse "clean project"

I have a multi-level maven project, which includes a major module which references all the other (also maven) projects:
<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.evercompliant</groupId>
<artifactId>PipelineMultiModule</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Pipeline Multi Module</name>
<description>Maven multi module project</description>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>../AggregationHandler</module>
<module>../CrawlerUtils</module>
<module>../CrawlManager</module>
<module>../CrawlerDevLibrary</module>
<module>../DigestManager</module>
<module>../GCrawler/GoogleCrawler</module>
<module>../UrlService</module>
<module>../WebPageCapture</module>
<module>../WhoisParser</module>
<module>../TextClassifier</module>
<module>../scanpipelineservice</module>
</modules>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
In order to do a full build on windows, I need to execute maven clean and maven install from eclipse.
For some reason, if I don't execute eclipse's "Clean all Projects" between mvn clean and mvn install, the artifact doesn't include the binaries of my project.
For example, the jar created for the AggregationHandler project, will include all of its dependencies (CrawlerUtils, for example), but not the code of AggregationHandler itself.
As I said, it could be fixed by executing "Clean all projects".
Here's the pom.xml file of the AggregationHandler project:
<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>
<artifactId>AggregationHandler</artifactId>
<name>Aggregation Handler</name>
<dependencies>
<dependency>
<groupId>com.evercompliant</groupId>
<artifactId>CrawlerUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.evercompliant.aggregationhandler.service.DoAction</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.evercompliant.aggregationhandler.service.DoAction</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
<parent>
<groupId>com.evercompliant</groupId>
<artifactId>PipelineMultiModule</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../PipelineMultiModule</relativePath>
</parent>
Problem is, I now need to build this project on a linux environment, without eclipse. Is there any change that I can do to the pom.xml file(s) in order to fix this problem?

m2e fails to execute wro4j plugin

I would like to use wro4j maven plugin in a project. I works using mvn command line, but not in Eclipse/m2e.
I tried both lifecycle-mapping customization, and wroj4j-m2e integration plugin.
Here is the error with lifecycle-mapping customization :
Execution default of goal ro.isdc.wro4j:wro4j-maven-plugin:1.6.0:run failed: Plugin ro.isdc.wro4j:wro4j-maven-plugin:1.6.0 or one of its dependencies could not be resolved: Failed to collect dependencies for ro.isdc.wro4j:wro4j-maven-plugin:jar:1.6.0 () (ro.isdc.wro4j:wro4j-maven-plugin:1.6.0:run:default:process-resources)
The log of m2eclipse (in .plugins\org.eclipse.m2e.logback.configuration) is empty about this error, even with debug output selected in Eclipse maven preferences.
m2e version : 1.2.0.20120903-1050
eclipse version : Juno Service Release 1
Here is the pom.xml (extract)
<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>test</groupId>
<artifactId>test-maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<wro4j.version>1.6.0</wro4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
<executions>
<execution>
<configuration>
<destinationFolder>${project.build.directory}/</destinationFolder>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<wroFile>${basedir}/src/main/config/wro.xml</wroFile>
<extraConfigFile>${basedir}/src/main/config/wro.properties</extraConfigFile>
<targetGroups>gss</targetGroups>
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/styles/</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/scripts/</jsDestinationFolder>
<contextFolder>${basedir}/src/main/</contextFolder>
<ignoreMissingResources>false</ignoreMissingResources>
<wroFile>${basedir}/src/main/config/wro.xml</wroFile>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- configure #!# m2eclipse -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<versionRange>[1.0,]</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

Resources