Appengine cloud endpoints v2: specify datastore in devserver - java

I migrated to cloud endpoints v2 following the migration document and v2 example from git repo (https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/endpoints-frameworks-v2). However, I am not sure on how to set jvmFlag(s) to specify additional properties like backend_store, port, enable debug etc like the it was in v1.
Here is the build tag from my pom.xml.
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId>
<version>2.1</version> <executions> <execution> <phase>compile</phase> <goals>
<goal>display-dependency-updates</goal> <goal>display-plugin-updates</goal>
</goals> </execution> </executions> </plugin> -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<devserver.storagePath>/Users/user/Documents/development/health/local_db.bin</devserver.storagePath>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>endpoints-framework-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<!-- plugin configuration -->
<hostname>amplified-lamp-688.appspot.com</hostname>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>3.6.2</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.4</version>
<configuration>
<!--<enableJarClasses>false</enableJarClasses>-->
<!--<!– Comment in the below snippet to bind to all IPs instead of just-->
<!--localhost –>-->
<!--<!– address>0.0.0.0</address> –>-->
<!--<port>8080</port>-->
<!--<!– Comment in the below snippet to enable local debugging with a remove-->
<!--debugger like those included with Eclipse or IntelliJ –>-->
<!--<jvmFlags>-->
<!--<jvmFlag>-Xdebug</jvmFlag>-->
<!--<jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>-->
<!--<jvmFlag>-Ddatastore.backing_store=/Users/user/Documents/development/health/local_db.bin</jvmFlag>-->
<!--<jvmFlag>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=10</jvmFlag>-->
<!--</jvmFlags>-->
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Please help with configuring the jvmFlags.

This is one of the solution to specify jvmFlags
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<!--<devserver.storagePath>/Users/user/Documents/development/health/local_db.bin</devserver.storagePath>-->
<devserver:port>8181</devserver:port>
<devserver.jvmFlags>-Xdebug</devserver.jvmFlags>
<devserver.jvmFlags>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</devserver.jvmFlags>
<devserver.jvmFlags>-Ddatastore.backing_store=/Users/user/Documents/development/health/local_db.bin</devserver.jvmFlags>
</configuration>
</plugin>

Related

Mystery directory created during maven compile

I have disabled all of the plugins in my module's pom.xml file and in the parent pom.xml file. I type
`mvn clean install -U`
and in the same directory
`${project.basedir}/src/main/site/resources/repo`
appears, approximately during the time the compile phase executes.
Any ideas about what could be causing this?
Edit:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>
<name>My Project</name>
<groupId>com.my</groupId>
<artifactId>my.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>openid-connect-client</module>
<module>openid-connect-common</module>
<module>openid-connect-server</module>
<module>my.libraries</module>
<module>my.rest</module>
<module>my.spark-utils</module>
<module>openid-connect-server-webapp</module>
</modules>
<repositories>
<repository>
<id>HortonWorks</id>
<url>http://nexus-private.hortonworks.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.basedir>.</project.basedir>
<java.version>1.8</java.version>
<scala.tools.version>2.11</scala.tools.version>
<scala-version>${scala.tools.version}.7</scala-version>
<flyway.maven.plugin.version>4.2.0</flyway.maven.plugin.version>
<maven.war.plugin.version>3.2.2</maven.war.plugin.version>
<maven.install.plugin.version>2.5.2</maven.install.plugin.version>
<sonar.jacoco.reportPaths>
target/coverage-reports/jacoco-ut.exec,target/coverage-reports/jacoco-it.exec
</sonar.jacoco.reportPaths>
<sonar.junit.reportPaths>target/surefire-reports</sonar.junit.reportPaths>
<findbugs.annotations.version>3.0.1</findbugs.annotations.version>
<findbugs.jsr305.version>3.0.2</findbugs.jsr305.version>
<scapegoat.version>1.3.5</scapegoat.version>
<apached.server.jndi.version>1.5.5</apached.server.jndi.version>
<aws-java-sdk.version>1.11.250</aws-java-sdk.version>
<!-- Commons -->
<commons-collections4.version>4.1</commons-collections4.version>
<commons.csv.version>1.1</commons.csv.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.lang3.version>3.5</commons.lang3.version>
<elasticsearch.version>6.2.3</elasticsearch.version>
<elasticsearch.transport.client.version>6.2.3</elasticsearch.transport.client.version>
<lucene.version>7.3.1</lucene.version>
<h2.version>1.4.192</h2.version>
<jboss.logging.version>3.3.1.Final</jboss.logging.version>
<jsoup.version>1.11.2</jsoup.version>
<jmockit.version>1.38</jmockit.version>
<jetty.version>9.4.14.v20181114</jetty.version>
<sonar.scoverage.reportPath>target/scoverage.xml</sonar.scoverage.reportPath>
<sonar.scala.scoverage.reportPath>${sonar.scoverage.reportPath}</sonar.scala.scoverage.reportPath>
<sonar.scala.scapegoat.reportPath>./target/scapegoat</sonar.scala.scapegoat.reportPath>
<sonar.scala.version>${scala-version}</sonar.scala.version>
<!-- Guava -->
<guava.version>22.0</guava.version>
<!-- Snappy -->
<snappy.version>1.0.5</snappy.version>
<!-- Spring -->
<spring.boot.version>1.5.14.RELEASE</spring.boot.version>
<spring.oauth2.version>2.1.0.RELEASE</spring.oauth2.version>
<spring.security.core>4.2.2.RELEASE</spring.security.core>
<spring.security.ldap.version>4.2.2.RELEASE</spring.security.ldap.version>
<spring.version>4.3.7.RELEASE</spring.version>
<!-- Hortonworks Ecosystem -->
<hdp.version>3.0.1.0-187</hdp.version>
<hadoop.version>3.1.1.${hdp.version}</hadoop.version>
<hbase.version>2.0.0.${hdp.version}</hbase.version>
<phoenix.version>5.0.0.${hdp.version}</phoenix.version>
<spark.version>2.3.1.${hdp.version}</spark.version>
<zookeeper.version>3.4.6.${hdp.version}</zookeeper.version>
<!-- Spark Variant -->
<!--<aehrc.variant.spark.version>0.2.0-a1</aehrc.variant.spark.version>-->
<aehrc.variant.spark.version>0.2.0-SNAPSHOT</aehrc.variant.spark.version>
<org.slf4j-version>1.7.25</org.slf4j-version>
</properties>
<profiles>
<!-- Environment Profiles -->
<profile>
<id>local</id>
<properties>
<activatedProfile>local</activatedProfile>
<!-- TODO: For all other env these will be stored on disk -->
<database.url>jdbc:postgresql://localhost:5432/my</database.url>
<database.user>username</database.user>
<database.password>password</database.password>
<postgresql.version>9.4-1200-jdbc41</postgresql.version>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>aws-dev</id>
<properties>
<activatedProfile>aws-dev</activatedProfile>
<!-- TODO: For all other env these will be stored on disk -->
<database.url>
jdbc:postgresql://hostname:5432/db
</database.url>
<database.user>user</database.user>
<database.password>password</database.password>
<postgresql.version>9.4-1200-jdbc41</postgresql.version>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
</profile>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- -Dtests.security.manager=false is needed otherwise the ESTestCase fails to initialize -->
<configuration>
<!--<argLine>-Xms128m -Xmx512m -Dtests.security.manager=false</argLine>-->
<argLine>${surefireArgLine}</argLine>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sonar</id>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!-- This plugin compiles Scala files -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<!-- The configuration is not included unless the profile is active. -->
<!-- This keeps the compiler plugin out of the equation and assists IntelliJ -->
<!-- as long as IntelliJ doesn't try to activate the sonar profile. -->
<configuration>
<scalaVersion>${scala.tools.version}</scalaVersion>
<args>
<arg>-P:scapegoat:dataDir:${sonar.scala.scapegoat.reportPath}
</arg>
<arg>-P:scapegoat:reportOnly:true</arg>
<arg>
-P:scapegoat:overrideLevels:TraversableHead=Warning:TraversableLast=Warning:OptionGet=Warning:MapGetAndGetOrElse=Warning
</arg>
</args>
<compilerPlugins>
<compilerPlugin>
<groupId>com.sksamuel.scapegoat</groupId>
<artifactId>scalac-scapegoat-plugin_${scala.tools.version}
</artifactId>
<version>${scapegoat.version}</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
...
</dependencies>
</dependencyManagement>
<dependencies>
...
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<highlighting>true</highlighting>
<scalaVersion>${scala.tools.version}</scalaVersion>
</configuration>
<executions>
<execution>
<id>instrument</id>
<goals>
<goal>pre-compile</goal>
<goal>post-compile</goal>
</goals>
</execution>
<execution>
<id>scoverage-report</id>
<goals>
<goal>report</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- This plugin compiles Scala files -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.3.2</version>
<executions>
<execution>
<id>add-scala-source</id>
<goals>
<goal>add-source</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.21.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven.install.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin.version}</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.maven.plugin.version}</version>
<configuration>
<baselineOnMigrate>true</baselineOnMigrate>
<url>${database.url}</url>
<user>${database.user}</user>
<password>${database.password}</password>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<systemProperties>
<spring.profiles.active>${activatedProfile}</spring.profiles.active>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>com.github.alexcojocaru</groupId>
<artifactId>elasticsearch-maven-plugin</artifactId>
<!-- REPLACE THE FOLLOWING WITH THE PLUGIN VERSION YOU NEED -->
<version>6.0</version>
<configuration>
<!-- REPLACE THE FOLLOWING WITH THE ELASTICSEARCH VERSION YOU NEED -->
<version>${elasticsearch.version}</version>
<clusterName>test</clusterName>
<!--These ports must also be changed in "classpath:test/application.properties".-->
<transportPort>9301</transportPort>
<httpPort>9201</httpPort>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.14.v20181114</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
</plugin>
<plugin>
<groupId>org.appfuse.plugins</groupId>
<artifactId>warpath-maven-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.8.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-extensions</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<executions>
<!--
Prepares the property pointing to the JaCoCo runtime agent which
is passed as VM argument when Maven the Surefire plugin is executed.
-->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>./target/coverage-reports/jacoco-ut.exec
</destFile>
<!--
Sets the name of the property containing the settings
for JaCoCo runtime agent.
-->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!--
Ensures that the code coverage report for unit tests is created after
unit tests have been run.
-->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>./target/coverage-reports/jacoco-ut.exec
</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>./target/site/jacoco-ut
</outputDirectory>
</configuration>
</execution>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>./target/coverage-reports/jacoco-it.exec
</destFile>
<!--
Sets the name of the property containing the settings
for JaCoCo runtime agent.
-->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!--
Ensures that the code coverage report for integration tests after
integration tests have been run.
-->
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>./target/coverage-reports/jacoco-it.exec
</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>./target/site/jacoco-it
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-requirements</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.5.3,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[${java.version},)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
The child pom:
<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>
<parent>
<groupId>com.my</groupId>
<artifactId>my.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>my.spark-utils</artifactId>
<name>SPARK-UTILS</name>
<packaging>jar</packaging>
<properties>
<scala.override.version>2.11.7</scala.override.version>
<guava.override.version>13.0.1</guava.override.version>
<jetty.override.version>9.3.19.v20170502</jetty.override.version>
</properties>
<profiles>
<profile>
<id>sonar</id>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.tools.version}</scalaVersion>
<args>
<arg>-P:scapegoat:dataDir:./target/scapegoat-report</arg>
<arg>-P:scapegoat:reportOnly:true</arg>
<arg>-P:scapegoat:overrideLevels:TraversableHead=Warning:TraversableLast=Warning:OptionGet=Warning:MapGetAndGetOrElse=Warning</arg>
</args>
<compilerPlugins>
<compilerPlugin>
<groupId>com.sksamuel.scapegoat</groupId>
<artifactId>scalac-scapegoat-plugin_${scala.tools.version}</artifactId>
<version>${scapegoat.version}</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<dependencies>
...
</dependencies>
<build>
<plugins>
<!-- This plugin compiles Scala files -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
<!-- This plugin compiles Java files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<!-- Maven Shade Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<minimizeJar>true</minimizeJar>
<relocations>
<relocation>
<pattern>it.unimi.dsi.fastutil</pattern>
<shadedPattern>my.it.unimi.dsi.fastutil</shadedPattern>
</relocation>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>my.com.google</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/license/**</exclude>
<exclude>META-INF/*</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>/*.txt</exclude>
<exclude>build.properties</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
<finalName>my-spark-utils</finalName>
</build>
I don't have enough space to include all of the dependency information.

Why the last plugin which is to generate report for my cucumber Test Scenario run is working

Why the last plugin which is to generate report for my cucumber Test Scenario run is working
Compile - Surefire SkipTest - Mvn-exec-Plgun with java- failsafe-verify
while running it from Maven
<!-- ####### maven-compiler-plugin ######### -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<!--fork>true</fork-->
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- ####### maven-surefire-plugin ######### -->
<plugin>
executions>
</plugin>
<!-- ####### maven-cucumber-reporting ######### -->
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>AutoRunner_Cucumber</projectName>
<outputDirectory>${project.build.directory}/cucumber-reports</outputDirectory>
<jsonFiles>
<!-- supports wildcard or name pattern -->
<param>${project.build.directory}/target/cucumber.json</param>
</jsonFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Forcing jaxb2-maven-plugin to generate setters or constructors

I have a following build configuration. It is working properly, however the problem is in case of generating constructor with all args or generating setters for list.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
<sources>
<source>src/main/resources/xsd</source>
</sources>
</configuration>
</plugin>
</plugins>
</build>
Can you tell me how to force xjc to generate setters for lists or args-constructors ?
This thing works for me
<configuration>
<args>
<arg>-Xvalue-constructor</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-value-constructor</artifactId>
<version>3.0</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.11.1</version>
</plugin>
</plugins>
</configuration>
Let me know if you find any issues with this.
For generating setter for the collection I added the dependency to org.andromda.thirdparty.jaxb2_commons but it' works only for the new version of jaxb2-maven-plugin. I tried with 2.5.0 and it's works, using the version 2.3.1 doesn't work.
Here an example:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5.0</version>
<dependencies>
<dependency>
<groupId>org.andromda.thirdparty.jaxb2_commons</groupId>
<artifactId>collection-setter-injector</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<executions>
<execution>
......
</execution>
</executions>
<configuration>
<sources>
......
</sources>
<arguments>-Xcollection-setter-injector</arguments>
<clearOutputDir>false</clearOutputDir>
<extension>true</extension>
</configuration>
</plugin>
To generate collection setters you have to add collection-setter-injector to jaxb plugin dependencies and for value constuctor generation - jaxb2-value-constructor. You also have to add proper args to argument list (-Xcollection-setter-injector and -Xvalue-constructor. Example plugin configuration in pom.xml:
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5.0</version>
<dependencies>
<dependency>
<groupId>org.andromda.thirdparty.jaxb2_commons</groupId>
<artifactId>collection-setter-injector</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-value-constructor</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<executions>
...
</executions>
<configuration>
<sources>
...
</sources>
<clearOutputDir>true</clearOutputDir>
<arguments>
<argument>-Xcollection-setter-injector</argument>
<argument>-Xvalue-constructor</argument>
</arguments>
<extension>true</extension>
</configuration>
</plugin>
</plugins>
</build>
...

Adobe flex migration error defaults.css expected

I am having an issue migrating from Adobe Flex 3.3.0.4852 to 4.5.1.21328
Applying the same configuration I had it set up it throws a exception executing flexmojos-maven-plugin
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.2.0</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleFiles>
<module>APP_MIGRATED.mxml</module>
</moduleFiles>
<locales>
<param>en_US</param>
</locales>
<services>${basedir}/src/main/resources/services-config.xml</services>
<contextRoot>root</contextRoot>
<keepAllTypeSelectors>true</keepAllTypeSelectors>
<output>${basedir}/target/APP_MIGRATED.swf</output>
<targetPlayer>9.0.0</targetPlayer>
</configuration>
</plugin>
The error is triying to compile the source it trows the next error:
[ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\advancedgrids\4.5.1.21328\advancedgrids-4.5.1.21328.swc$defaults.css:[13,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\charts\4.5.1.21328\charts-4.5.1.21328.swc$defaults.css:[13,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\charts\4.5.1.21328\charts-4.5.1.21328.swc$defaults.css:[14,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\charts\4.5.1.21328\charts-4.5.1.21328.swc$defaults.css:[108,-1]
Unexpected character: D. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\charts\4.5.1.21328\charts-4.5.1.21328.swc$defaults.css:[112,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\framework\4.5.1.21328\framework-4.5.1.21328.swc$defaults.css:[15,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\mx\4.5.1.21328\mx-4.5.1.21328.swc$defaults.css:[15,-1]
{ expected. [ERROR]
C:\m2_repo_clean\com\adobe\flex\framework\spark\4.5.1.21328\spark-4.5.1.21328.swc$defaults.css:[15,-1]
{ expected. [WARNING]
C:\Workspaces\aa_Branches\aa_jdk8_upgrade\flex\src\main\flexapp\APP_MIGRATED.mxml:[0,-1]
CSS selector condition type is not supported: ':normalWithPrompt'
[WARNING]
C:\Workspaces\aa_Branches\aa_jdk8_upgrade\flex\src\main\flexapp\APP_MIGRATED.mxml:[0,-1]
CSS selector condition type is not supported: ':disabledWithPrompt'
This is my full pom configuration
<parent>
<artifactId>app-migrated</artifactId>
<groupId>com.appmigrated</groupId>
<version>1.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>flex</artifactId>
<packaging>pom</packaging>
<name>Flex</name>
<build>
<finalName>APP_MIGRATED</finalName>
<sourceDirectory>src/main/flexapp</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
<resource>
<directory>${basedir}/target/generated-resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flex-mojos.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleFiles>
<module>APP_MIGRATED.mxml</module>
</moduleFiles>
<locales>
<param>en_US</param>
</locales>
<services>${basedir}/src/main/resources/services-config.xml</services>
<contextRoot>root</contextRoot>
<keepAllTypeSelectors>true</keepAllTypeSelectors>
<output>${basedir}/target/APP_MIGRATED.swf</output>
<targetPlayer>9.0.0</targetPlayer>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>wrapper</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<ignoreVersionIssues>true</ignoreVersionIssues>
<htmlName>APP_MIGRATED</htmlName>
<outputDirectory>${project.build.directory}/html-wrapper</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-config</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
<includeArtifacIds>APP_MIGRATED</includeArtifacIds>
<includeGroupIds>${project.groupId}</includeGroupIds>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make.html-bundle</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/main/assembly/html-bundle.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make.resources</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/main/assembly/resources.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<flex.sdk.version>4.5.1.21328</flex.sdk.version>
<flex-mojos.version>4.0-RC2</flex-mojos.version>
</properties>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.cairngorm</groupId>
<artifactId>cairngorm</artifactId>
<version>2.2.1</version>
<type>swc</type>
</dependency>
</dependencies>
I know maybe there is can be another errors after this one, but this is the one which concerns me more.
Greetings,
try flexmojos 7 :
<properties>
<flexmojos.version>7.0.1</flexmojos.version>
<flex.version>4.13.0.20140701</flex.version>
<flash.version>16.0</flash.version>
</properties>
plugin look like this
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<sourceFile>APP_MIGRATED.mxml</sourceFile>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
</compilerWarnings>
</configuration>
<dependencies>
<!-- This handles a bug in maven which causes problems with flex resources -->
<dependency>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
<version>${flexmojos.version}</version>
</dependency>
<!-- Without this FM will use the compiler configured in its master
pom, which will result in version conflicts -->
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>

Maven dependency not copied to WEB-INF\lib folder

No matter how much I do mvn clean install even with -U this dependency (along with some other) is not being coped into the target\app-1.0-SNAPSHOT\WEB-INF\lib folder:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-webmvc</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
Not sure why this happens now, when in the pom.xml there is the <packaging>war</packaging>
build
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.version}</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Copies static web files from src/main/webapp to target/${webappDirectory} -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<!-- the exploded goal gets executed during compile phase -->
<phase>compile</phase>
<goals>
<goal>exploded</goal>
<goal>war</goal>
</goals>
</execution>
</executions>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>

Categories