How to pass maven-surefire-plugin params via command line - maven-surefire-plugin

According to the following page it is possible to specify custom listeners for the TestNG in the following way:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<properties>
<property>
<name>listener</name>
<value>
com.mycompany.MyResultListener,com.mycompany.MyAnnotationTransformer,com.mycompany.MyMethodInterceptor
</value>
</property>
</properties>
</configuration>
</plugin>
My question is how can I do the same (to provide custom listeners) but via command line?

You can simply define a property say tCustomListener
<properties>
<tCustomListener>intelligent_default_listener</value>
</properties>
and pass it to <value> with ${tCustomListener}
Run with -DtCustomListener=yourvalues

Related

Gatling : Scala - Could not find or load main class Engine

I am getting error Could not find or load main class Engine while running the simulation through command line. I used below command to create the jar file.
mvn clean scala:compile assembly:single package
Folder Structure
src
test
resources
scala
testrunner
testsimuation1.scala
Engine
IDEPathHelper
Recorder
Maven - 3.6.3
Intellij - 2021.1
Scala - 2.13.10
Gatling - 3.9.0
JDK - 1.8
Below is the 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>io.gatling.demo</groupId>
<artifactId>gatling-maven-plugin-demo-scala</artifactId>
<version>3.9.0</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gatling.version>${project.version}</gatling.version>
<gatling-maven-plugin.version>4.2.9</gatling-maven-plugin.version>
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<scala-maven-plugin.version>4.8.0</scala-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>${gatling.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/test/resources</directory>
</resource>
</resources>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling-mvn-plugin.version}</version>
<configuration>
<configFolder>src/test/resources</configFolder>
<simulationsFolder>src/test/scala</simulationsFolder>
<resultsFolder>src/results</resultsFolder>
<simulationClass>testrunner.testsimuation1</simulationClass>
<jvmArgs>
<jvmArg>-Dsimulation=testsimuation1</jvmArg>
<jvmArg>-Xmx6g</jvmArg>
<jvmArg>-Xms2g</jvmArg>
</jvmArgs>
</configuration>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.4.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>io.gatling.app.Gatling</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
I tried moving src/test -> src/main but it threw the compilation error. Using this tool for the first time and struggling to resolve the issues.
I tried few solutions from other threads. It didn't help.
Thanks
The Engine class is only supposed to be used as a helper to launch with a "Right Click" when using your IDE.
Using this tool for the first time and struggling to resolve the issues.
You're using maven. The way you're supposed to be running Gatling with maven is to run mvn gatling:test, see gatling-maven-plugin's documentation.
Whatever else you're doing with maven-assembly-plugin is custom development, not really related to Gatling.
Note: if you're looking for handling Gatling deployments, Gatling Enterprise is an option.

How can I correctly install the extend QrScanner

I already installed the extend, but the documentation says that I have to reload the app (I've tried everything and can't do it), before it was only necessary to refresh the CN1Libs, how should I do it now?
private void lectorCodigoQR() {
if (CodeScanner.isSupported()) {
CodeScanner.getInstance().scanQRCode(new ScanResult() {
#Override
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
// Mostrar
}
#Override
public void scanCanceled() {
System.out.println("cancelled");
}
#Override
public void scanError(int errorCode, String message) {
System.out.println("err " + message);
}
});
} else {
Dialog.show("Error", "Su dispositivo no soporta el lector de QR", "Continuar", null);
}
}
<?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>
<parent>
<groupId>com.innova507.taxi507</groupId>
<artifactId>taxi507</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.innova507.taxi507</groupId>
<artifactId>taxi507-common</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Add your cn1lib dependencies to this section -->
<dependencies>
<dependency>
<groupId>com.codenameone</groupId>
<artifactId>codenameone-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<artifactId>taxi507-cn1-codescan</artifactId>
<groupId>com.innova507.taxi507</groupId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
</dependency>
<!-- INJECT DEPENDENCIES -->
</dependencies>
<!-- The following are profiles to cover special cases -->
<profiles>
<!-- A profile to install Codename One support libraries to your home directory
if they aren't installed yet. -->
<profile>
<id>install-codenameone</id>
<activation>
<file>
<missing>${user.home}/.codenameone/guibuilder.jar</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="install-cn1">
<available file="${user.home}/.codenameone/guibuilder.jar" property="codenameone.present"/>
<mkdir dir="${user.home}/.codenameone"/>
<mkdir dir="${project.build.directory}/codenameone/tmpProject"/>
<get src="https://www.codenameone.com/files/updates/UpdateCodenameOne.jar"
dest="${user.home}/UpdateCodenameOne.jar"
skipexisting="true"/>
<java jar="${user.home}/UpdateCodenameOne.jar" fork="true">
<arg value="${project.build.directory}/codenameone/tmpProject"/>
<arg value="force"/>
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- A profile to add kotlin support. Activated if the src/main/kotlin
directory exists -->
<profile>
<id>kotlin</id>
<activation>
<file>
<!-- To enable Kotlin, add the following file to the project base dir -->
<exists>${basedir}/src/main/kotlin</exists>
</file>
</activation>
<properties>
<kotlin.version>1.3.72</kotlin.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-annotations-jvm -->
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
</dependency>
<dependency>
<groupId>com.codenameone</groupId>
<artifactId>java-runtime</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/codenameone_settings.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
<args>
<arg>-no-reflect</arg>
<arg>-no-jdk</arg> <!-- No JDK -->
</args>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
<args>
<arg>-no-reflect</arg>
<arg>-no-jdk</arg> <!-- No JDK -->
</args>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>javase</id>
<activation>
<property>
<name>codename1.platform</name>
<value>javase</value>
</property>
</activation>
<properties>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>java</executable>
<longClasspath>true</longClasspath>
<arguments>
<argument>-Xmx1024M</argument>
<!--<argument>-Xdebug</argument>
<argument>-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n</argument>-->
<argument>-classpath</argument>
<classpath />
<argument>${exec.mainClass}</argument>
<argument>${cn1.mainClass}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!--
For running in simulator in process use:
mvn cn1:java -P simulator
Fro running in simulator in forked process use:
mvn cn1:simulator -P simulator
-->
<id>simulator</id>
<properties>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending iOS debug builds use:
mvn cn:build -P ios-debug
-->
<id>ios-debug</id>
<properties>
<!-- Build server target type -->
<codename1.targetType>iphone</codename1.targetType>
<!-- Used for identifying native interfaces. Should match correct subdirectory of native -->
<codename1.targetPlatform>ios</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending iOS debug builds use:
mvn cn:build -P ios-release
-->
<id>ios-release</id>
<properties>
<!-- Build server target type -->
<codename1.targetType>iphone</codename1.targetType>
<codename1.production>true</codename1.production>
<!-- Used for identifying native interfaces. Should match correct subdirectory of native -->
<codename1.targetPlatform>ios</codename1.targetPlatform>
<codename1.appStoreBuild>true</codename1.appStoreBuild>
</properties>
</profile>
<profile>
<!--
For sending Javascript builds use:
mvn cn:build -P javascript
-->
<id>javascript</id>
<properties>
<codename1.targetType>javascript</codename1.targetType>
<codename1.targetPlatform>javascript</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Android builds use:
mvn cn:build -P android
-->
<id>android</id>
<properties>
<codename1.targetType>android</codename1.targetType>
<codename1.targetPlatform>android</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Windows UWP builds use:
mvn cn:build -P uwp
-->
<id>uwp</id>
<properties>
<codename1.targetType>windows</codename1.targetType>
<codename1.targetPlatform>win</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Windows desktop builds use:
mvn cn:build -P windows
-->
<id>windows</id>
<properties>
<codename1.targetType>desktop_windows</codename1.targetType>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Mac Desktop builds use:
mvn cn:build -P mac
-->
<id>mac</id>
<properties>
<codename1.targetType>desktop_macosx</codename1.targetType>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/codenameone_settings.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.codenameone</groupId>
<artifactId>codenameone-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-gui-sources</id>
<phase>process-sources</phase>
<goals>
<goal>generate-gui-sources</goal>
</goals>
</execution>
<execution>
<id>cn1-process-classes</id>
<phase>process-classes</phase>
<goals>
<goal>compliance-check</goal>
<goal>css</goal>
<!--<goal>compile-javase-sources</goal>-->
</goals>
</execution>
<execution>
<id>attach-test-artifact</id>
<phase>test</phase>
<goals>
<goal>attach-test-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I have included an image of the tree where it shows the menu on the pom and I don't see a way to update it. I am also including the pom.xml (if it has the extension included)
https://drive.google.com/drive/folders/1LVBZPMCTTTEZxEYfwrh3S2_fPzyktTiN
This is an answer from Steve Hannha:
I just created a fresh project in the cn1 intializr with "NetBeans" selected as the IDE.
Opened project in NetBeans 12.3 on Windows 10.
Opened CN1 Settings.
Installed Codename One Scanner library.
Initially the text editor wasn't giving me any autocomplete or error-underlines on anything, even from cn1 core classes.
I right-clicked on the "common" module, and selected "Resolve Project Problems"
I got a dialog with errors like "Some dependency artifacts are not in the local repository".
When I pressed the "Resolve..." button in that dialog, it downloaded the dependencies and things started to magically work.

Codename One - GifImage not supported

I am developing a simple Android-Mobile-App that uses a Gif. It's a Maven project.
I have imported the Animated-Gif-Support library and used the code form here.
Unfortunately, when I paste the sample code into my project, Eclipse can't find the method and returns the error: GifImage cannot be resolved.
hi.add(BorderLayout.CENTER, new ScaleImageLabel(GifImage.decode(getResourceAsStream("/giphy-downsized.gif"), 1177720)));
I have restarted Eclipse and refreshed the libraries, all to no avail.
Any suggestions?
Code from 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>
<parent>
<groupId>com.example.minhaagenda</groupId>
<artifactId>minhaagenda</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.example.minhaagenda</groupId>
<artifactId>minhaagenda-common</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Add your cn1lib dependencies to this section -->
<dependencies>
<dependency>
<groupId>com.codenameone</groupId>
<artifactId>codenameone-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<artifactId>minhaagenda-AnimatedGifSupport</artifactId>
<groupId>com.example.minhaagenda</groupId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
</dependency>
<!-- INJECT DEPENDENCIES -->
</dependencies>
<!-- The following are profiles to cover special cases -->
<profiles>
<!-- A profile to install Codename One support libraries to your home directory
if they aren't installed yet. -->
<profile>
<id>install-codenameone</id>
<activation><file><missing>${user.home}/.codenameone/guibuilder.jar</missing></file></activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="install-cn1">
<available file="${user.home}/.codenameone/guibuilder.jar" property="codenameone.present"/>
<mkdir dir="${user.home}/.codenameone"/>
<mkdir dir="${project.build.directory}/codenameone/tmpProject"/>
<get src="https://www.codenameone.com/files/updates/UpdateCodenameOne.jar"
dest="${user.home}/UpdateCodenameOne.jar"
skipexisting="true"/>
<java jar="${user.home}/UpdateCodenameOne.jar" fork="true">
<arg value="${project.build.directory}/codenameone/tmpProject"/>
<arg value="force"/>
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- A profile to add kotlin support. Activated if the src/main/kotlin
directory exists -->
<profile>
<id>kotlin</id>
<activation>
<file>
<!-- To enable Kotlin, add the following file to the project base dir -->
<exists>${basedir}/src/main/kotlin</exists>
</file>
</activation>
<properties>
<kotlin.version>1.3.72</kotlin.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-annotations-jvm -->
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
</dependency>
<dependency>
<groupId>com.codenameone</groupId>
<artifactId>java-runtime</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/codenameone_settings.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
<args>
<arg>-no-reflect</arg>
<arg>-no-jdk</arg> <!-- No JDK -->
</args>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
<args>
<arg>-no-reflect</arg>
<arg>-no-jdk</arg> <!-- No JDK -->
</args>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>javase</id>
<activation>
<property>
<name>codename1.platform</name>
<value>javase</value>
</property>
</activation>
<properties>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>java</executable>
<longClasspath>true</longClasspath>
<arguments>
<argument>-Xmx1024M</argument>
<!--<argument>-Xdebug</argument>
<argument>-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n</argument>-->
<argument>-classpath</argument>
<classpath />
<argument>${exec.mainClass}</argument>
<argument>${cn1.mainClass}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!--
For running in simulator in process use:
mvn cn1:java -P simulator
Fro running in simulator in forked process use:
mvn cn1:simulator -P simulator
-->
<id>simulator</id>
<properties>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending iOS debug builds use:
mvn cn:build -P ios-debug
-->
<id>ios-debug</id>
<properties>
<!-- Build server target type -->
<codename1.targetType>iphone</codename1.targetType>
<!-- Used for identifying native interfaces. Should match correct subdirectory of native -->
<codename1.targetPlatform>ios</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending iOS debug builds use:
mvn cn:build -P ios-release
-->
<id>ios-release</id>
<properties>
<!-- Build server target type -->
<codename1.targetType>iphone</codename1.targetType>
<codename1.production>true</codename1.production>
<!-- Used for identifying native interfaces. Should match correct subdirectory of native -->
<codename1.targetPlatform>ios</codename1.targetPlatform>
<codename1.appStoreBuild>true</codename1.appStoreBuild>
</properties>
</profile>
<profile>
<!--
For sending Javascript builds use:
mvn cn:build -P javascript
-->
<id>javascript</id>
<properties>
<codename1.targetType>javascript</codename1.targetType>
<codename1.targetPlatform>javascript</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Android builds use:
mvn cn:build -P android
-->
<id>android</id>
<properties>
<codename1.targetType>android</codename1.targetType>
<codename1.targetPlatform>android</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Windows UWP builds use:
mvn cn:build -P uwp
-->
<id>uwp</id>
<properties>
<codename1.targetType>windows</codename1.targetType>
<codename1.targetPlatform>win</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Windows desktop builds use:
mvn cn:build -P windows
-->
<id>windows</id>
<properties>
<codename1.targetType>desktop_windows</codename1.targetType>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
<profile>
<!--
For sending Mac Desktop builds use:
mvn cn:build -P mac
-->
<id>mac</id>
<properties>
<codename1.targetType>desktop_macosx</codename1.targetType>
<codename1.targetPlatform>javase</codename1.targetPlatform>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/codenameone_settings.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.codenameone</groupId>
<artifactId>codenameone-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-gui-sources</id>
<phase>process-sources</phase>
<goals>
<goal>generate-gui-sources</goal>
</goals>
</execution>
<execution>
<id>cn1-process-classes</id>
<phase>process-classes</phase>
<goals>
<goal>compliance-check</goal>
<goal>css</goal>
<!--<goal>compile-javase-sources</goal>-->
</goals>
</execution>
<execution>
<id>attach-test-artifact</id>
<phase>test</phase>
<goals>
<goal>attach-test-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Bad request when updating Appengine with mvn appengine:update

i'm getting the following error, when I try to update a appengine-application with the appengine-maven-plugin:
400 Bad Request
Error when loading application configuration:
Unable to assign value '1.8.3' to attribute 'version':
Value '1.8.3' for version does not match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$'
This is confusing to my because my appengine-web.xml looks like follows:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>helloworld</application>
<version>0-0-1</version>
<threadsafe>true</threadsafe>
<precompilation-enabled>false</precompilation-enabled>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>
I'm wondering why appengine-maven-plugin wants to use 1.8.3 as application-version. 1.8.3 is the version of appengine-sdk i want to use.
In my POM it's configured as follows:
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
and later on
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.version}</version>
<configuration>
<appVersion>${appengine.app.version}</appVersion>
</configuration>
</plugin>
${appengine.app.version} points to 1.8.3
I'm using Maven in Version 3.1 and Java 1.7.0_25
What do I wrong? Can anyone help my?
Thanks a lot
I had the same issue as you described. When I added the "version" element in the configuration element, with value pointing to the version of the app in my appengine-web.xml file, mvn appengine:update completed successfully. (maven v3.1.0, appengine plugin v1.8.3)
in pom.xml:
....
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.version}</version>
<configuration>
<version>MY-VERSION</version>
</configuration>
</plugin>
...
in appengine-web.xml:
...
<version>MY-VERSION</version>
...
If you generated the project with the archetype skeleton, like I did, and you have a block similar to
<properties>
<app.id>MY-GAE-PROJECT-ID</app.id>
<app.version>1</app.version>
<appengine.version>1.9.20</appengine.version>
<gcloud.plugin.version>0.9.58.v20150505</gcloud.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
in your pom.xml and your appengine-web.xml looked like
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>${app.id}</application>
<version>1</version>
etc....
when it got made, then, modify appengine-web.xml to be ${app.version} because they so helpfully already added that property with the archetype but never used it anywhere. Then, update your pom.xml's app.version to be your appropriate version (if you don't use "1"). Then, scroll down in the pom.xml to where you see
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
and inside the configuration block there add
<version>${app.version}</version>
Try to change appengine-web.xml entry from <version>0-0-1</version> to <version>1</version>. Regards, Adam.
In changed only the pom.xml file by adding the plugin>configuration>version tag (per below)...
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${project.appengine.version}</version>
<configuration>
<port>8888</port>
*<version>${app.version}</version>*
</configuration>
</plugin>
The way I solved this issue was trivial in my console I executed mvn clean install and then the appcfg.cmd -A [your app] update target\appengine-try-java-1.0 command.

maven-surefire-plugin and ReportNG cannot change stylesheet for the test report

I like to change style (use another .css than reportng.css) on the standard report from ReportNG using Maven. My pom.xlm looks like this
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,org.testng.reporters.EmailableReporter</value> </property>
</properties>
<systemProperties>
<property>
<name>org.uncommons.reportng.title</name>
<value>My own titel in Test Report</value>
</property>
<property>
<name>org.uncommons.reportng.stylesheet</name>
<value>${project.basedir}/src/report/resources/MyTestReport.css</value>
</property>
</systemProperties>
...
I can change title but when I try to do the same with systemproperty org.uncommons.reportng.stylesheet I just get the default report. Have some one had the same problem and how did you solve it?
Best regards
Annika
I thought I had the same problem because I was expecting to see the CSS file I specified embedded on all pages.
Instead, it looks like ReportNG takes the styles from the css you specify (MyTestReport.css in your example above) and puts it into the generated custom.css file that is embedded on all pages.
Check **/surefire-reports/html/custom.css. Your styles should be there (assuming the path to your CSS is correct).

Resources