deploy zip created by grunt to maven repository - maven

I use the frontend-maven-plugin to run a grunt build with maven.
I have the following 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.a.b</groupId>
<artifactId>kuku</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
<version>0.0.19</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.10.33</nodeVersion>
<npmVersion>1.4.28</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build-nightly --no-color</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The grunt task creates a zip file which is called kuku.zip. I want to deploy this zip file to a maven repository.
There are questions on deploying zip files to maven:
Jenkins "Post Build Action" to deploy zip on Maven repository
But here the situation is different because there already a jar is created and i want to attach an additional zip file and here i don't have another artifact.
How can i achieve this task with maven?

I followed the approach of maven-assembly-plugin.
First i defined an assembly descriptor.xml
<assembly>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>kuku</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
and here is the changed pom
<?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>a.b</groupId>
<artifactId>kuku</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
<version>0.0.19</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.10.33</nodeVersion>
<npmVersion>1.4.28</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build-nightly --no-color</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>descriptor.xml</descriptor>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Related

Unable to build maven project - M1

I'm an on M1 MAC trying to use the Azul jdk: https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-jdk8.0.332-macosx_aarch64.dmg
I've installed it (see outputs below):
java -version
openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-macos-aarch64) (build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Zulu 8.64.0.19-CA-macos-aarch64) (build 25.345-b01, mixed mode)
javac -version
javac 1.8.0_345
My error comes when I do a mvn clean install -e. This is the output:
I've also upgraded the frontend-maven-plugin to 1.11.0, which I've seen is necessary for the M1. At this point, I'm not sure where to go. Below is the pom.xml for ems_react_ui
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inc.gem</groupId>
<artifactId>ems_react_ui</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>com.inc</groupId>
<artifactId>gem</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<build>
<finalName>ems_react_ui</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>../ems/src/main/webapp/scripts/react</directory>
<includes>
<include>**/**</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>./node</directory>
<includes>
<include>**/**</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.0</version>
<configuration>
<workingDirectory>./</workingDirectory>
<environmentVariables>
<!-- Avoid certificates issues for npm install, needed behind a corporate proxy -->
<NODE_TLS_REJECT_UNAUTHORIZED>0</NODE_TLS_REJECT_UNAUTHORIZED>
</environmentVariables>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.14.1</nodeVersion>
<npmVersion>3.10.8</npmVersion>
</configuration>
</execution>
<execution>
<!-- npm runs in the docker context and needs to be normal user for execution -->
<id>npm config set user root</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>config set user root</arguments>
</configuration>
</execution>
<execution>
<id>npm i</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>i</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-react-to-webapp</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>../ems/src/main/webapp/scripts/react/dist</outputDirectory>
<resources>
<resource>
<directory>./dist</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-mainjs-to-webapp</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>../ems/src/main/webapp/scripts/react/</outputDirectory>
<resources>
<resource>
<directory>./</directory>
<includes>
<include>main.js</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Output of echo $PATH =
/Users/danieljohnson/.pyenv/shims:/Users/danieljohnson/.pyenv/bin:/Users/danieljohnson/.nvm/versions/node/v10.24.1/bin:/usr/local/opt/python#3.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/python#3.7/bin/pip3:/usr/local/opt/python#3.7/bin/python3:/Applications/Postgres.app/Contents/Versions/latest/bin
Version 14.15.4 fixed this isse for me (and I removed the npm version)
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v14.15.4</nodeVersion>
</configuration>

How to generate "HTML Reports" using latest version (3.1.1) of jmeter-maven-plugin

I'm able to generate HTML reports when I use 2.8.0 version of jmeter-maven-plugin. I clearly see one folder target\jmeter\reports. However, when I use 3.1.1 (latest) version, I don't see this folder at all.
Please let me know if there is any way to generate HTML reports with the latest version.
Below is my sample of my pom.xml:
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.8.0</version>
<executions>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
<configuration>
<generateReports>true</generateReports>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> ```
This configuration block:
<configuration>
<generateReports>true</generateReports>
</configuration>
must be outside of the <execution> block
Full pom.xml just in case:
<?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>org.example</groupId>
<artifactId>jmeter</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>3.1.1</version>
<executions>
<!-- Generate JMeter configuration -->
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<generateReports>true</generateReports>
</configuration>
</plugin>
</plugins>
</build>
</project>
More information:
JMeter Maven Plugin - Generating Reports
How to Use the JMeter Maven Plugin

Integrate create-react-app into maven build process

I am trying to integrate a recently created ReactJs application into the build process of the rest of my larger maven based application. I have done this in the past for an AngularJs application using npm, Gulp, and Bower. The difference this time around is that I am using Yarn but also the create-react-app base application from Facebook which relies on the 'react-scripts' development dependencies.
Previously my pom.xml for the maven project that built the AngularJs app looked as so:
<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>myapp</artifactId>
<packaging>war</packaging>
<name>MyApp Service</name>
<description>MyApp Service</description>
<parent>
...
</parent>
<profiles>
<profile>
<id>exec-unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<npmexec>npm</npmexec>
<gulpexec>gulp</gulpexec>
<bowerexec>bower</bowerexec>
</properties>
</profile>
</profiles>
<properties>
<frontendDir>src/main/myappui</frontendDir>
</properties>
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>npm install</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>${npmexec}</executable>
<arguments>
<argument>install</argument>
</arguments>
<workingDirectory>${frontendDir}</workingDirectory>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>${bowerexec}</executable>
<arguments>
<argument>install</argument>
</arguments>
<workingDirectory>${frontendDir}</workingDirectory>
</configuration>
</execution>
<execution>
<id>gulp build</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>${gulpexec}</executable>
<arguments>
<argument>prepare-for-maven-war</argument>
</arguments>
<workingDirectory>${frontendDir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I am not particularly sure what to do about the 'react-scripts' part. I tried adding <yarnexec>yarn</yarnexec> with an execution for yarn install and yarn build but it didn't provide desired results.

How to override default binding to phase of a Maven plugin

I want to define different executions for plugins in the pluginManagement of my parent pom and then bind specific executions to phases in the child poms.
I see inconsistent behavior depending on the plugin used and the location of the pluginManagement section.
In this first example the pluginManagement is located in the parent pom, defining 2 executions for compiler plugin and 2 executions for antrun plugin.
<?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">
<name>master-pom</name>
<modelVersion>4.0.0</modelVersion>
<groupId>plugin.test</groupId>
<artifactId>master-pom</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>none</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.6</source>
<target>1.6</target>
<includes>
<include>**/*</include>
</includes>
</configuration>
</execution>
<execution>
<id>execution-2</id>
<phase>none</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<includes>
<include>**/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>execution-1</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="execution 1"/>
</target>
</configuration>
</execution>
<execution>
<id>execution-2</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="execution 1"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
And the child pom:
<?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">
<name>build</name>
<modelVersion>4.0.0</modelVersion>
<groupId>plugin.test</groupId>
<artifactId>build</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
<groupId>plugin.test</groupId>
<artifactId>master-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>./master-pom.xml</relativePath>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
Running 'mvn clean install' on the child pom will run both executions of the compiler plugin and only the 1st execution of the antrun plugin, although only the 1st execution of each was bound to a phase.
Now moving the pluginManagement to the child pom:
<?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">
<name>build</name>
<modelVersion>4.0.0</modelVersion>
<groupId>plugin.test</groupId>
<artifactId>build</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>none</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.6</source>
<target>1.6</target>
<includes>
<include>**/*</include>
</includes>
</configuration>
</execution>
<execution>
<id>execution-2</id>
<phase>none</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<includes>
<include>**/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>execution-1</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="execution 1"/>
</target>
</configuration>
</execution>
<execution>
<id>execution-2</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="execution 2"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>execution-1</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
This pom gives the desired behavior which is running only the 1st execution for each plugin.
The compiler plugin (and most others) works correctly only in the case where the pluginManagement is located in the same pom and every execution is bound to phase=none (probably because it binds executions to a default phase).
The antrun plugin works correctly in any case.
How can I achieve this while having the pluginManagement section in the parent pom and without having to specifically bind unwanted executions to phase=none in the child poms?
Is this a bug in Maven or is this behavior somehow justified?
I have tried this on Maven 3.0.4 and Maven 2.2.1 with the same results.
The example provided works correctly. I had not redeployed the parent after including the fix.
Most plugins will bind executions to a default phase. So when one execution of a plugin is triggered, all unbound executions will be bound to the default phase and will also run.
To avoid this behavior, all executions of the plugin in the pluginManagement section of the parent pom should be bound to phase=none (as shown in the provided example). This way no execution will run unless the phase is explicitly overridden in the child poms.

How to use master pom file to checkout all modules of a web application and build all modules

I have a web application that relies on several modules. So to build it, I have a master pom.xml file. What I want this pom file to do is to checkout out all the modules.
below is my pom file.
<executions>
<execution>
<id>check-out-project1</id>
<phase>generate-sources</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<checkoutDirectory>${project.build.directory}/module1</checkoutDirectory>
<connectionUrl>scm:svn:svn://svnserver/svn/module1/trunk</connectionUrl>
<!--<developerConnection>scm:svn:svn://svnserver/svn/module1/trunk</developerConnection>!-->
<username>username</username>
<password>password</password>
</configuration>
</execution>
<execution>
<id>check-out-project2</id>
<phase>generate-sources</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<checkoutDirectory>${project.build.directory}/module1</checkoutDirectory>
<connectionUrl>scm:svn:svn://svnserver/svn/module1/trunk</connectionUrl>
<username>username</username>
<password>password</password>
</configuration>
</execution>
</executions>
I have tried mvn scm:checkout and mvn scm:checkout -check-out-project1 but it give me the error:
Cannot run checkout command : Can't load the scm provider. You need to define a connectionUrl parameter.
I don't understand why this is happening since I have the connectionUrl parameters defined inside the pom file already,the ideas point that I want to get to is having the pom file configured to be able to checkout multiple projects at the same time. Please let me know what I am doing wrong here, Thanks in Advance.
I found that if placing each of the checkouts into its own <execution> ... </execution> and within place the individual <configuration> ... </configuration> for them works. For example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<executions>
<execution>
<id>repo1-dependency</id>
<phase>generate-sources</phase>
<configuration>
<connectionUrl>${my.repo1.url}</connectionUrl>
<scmVersion>${my.repo1.branch}</scmVersion>
<scmVersionType>branch</scmVersionType>
<checkoutDirectory>${project.build.directory}/${my.repo1}-${my.repo1.branch}</checkoutDirectory>
</configuration>
<goals>
<goal>checkout</goal>
</goals>
</execution>
<execution>
<id>repo2-dependency</id>
<phase>generate-sources</phase>
<configuration>
<connectionUrl>${my.repo2.url}</connectionUrl>
<scmVersion>${my.repo2.branch}</scmVersion>
<scmVersionType>branch</scmVersionType>
<checkoutDirectory>${project.build.directory}/${my.repo2}-${my.repo2.branch}</checkoutDirectory>
</configuration>
<goals>
<goal>checkout</goal>
</goals>
</execution>
</executions>
</plugin>
I faced to same situation and I found a solution -using your code :D- that works on my computer:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.xxx.internet</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://www.mySite.de</url>
<scm>
<connection>scm:svn:http://svn-repo-adress:8080/repo/myDirectory</connection>
<developerConnection>http://svn-repo-adress:8080/repo/myDirectory</developerConnection>
<tag>HEAD</tag>
<url>http://svn-repo-adress:8080/repo/myDirectory</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.6</version>
<configuration>
<goals>checkout</goals>
<checkoutDirectory>target/checkout</checkoutDirectory>
<username>username</username>
<password>userpassword</password>
</configuration>
<executions>
<execution>
<id>check-out-project1</id>
<phase>generate-sources</phase>
<goals>
<goal>checkout</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
After I executed "mvn scm:checkout" on the cmd console it did work.
I think the important point was to add the scm tag first, before I had executed the build tag.

Resources