maven-frontend-plugin build error - maven

I have been working on getting angular 2 setup in eclipse. I ran into an error when setting up maven. I am relatively new to maven and I am unsure on how to overcome the error. Any help would be appreciated.
[INFO] --- frontend-maven-plugin:1.0:npm (npm install) # BudgetCalculator ---
[INFO] Running 'npm install' in /Users/csexton/Eclipse-Workspace/REST/BudgetCalculator
[INFO] budget_calculator#1.0.0 /Users/csexton/Eclipse-Workspace/REST/BudgetCalculator
[INFO] +-- angular2#2.0.0-beta.17
[INFO] +-- UNMET PEER DEPENDENCY es6-shim#^0.35.0
[INFO] +-- UNMET PEER DEPENDENCY reflect-metadata#0.1.2
[INFO] +-- UNMET PEER DEPENDENCY rxjs#5.0.0-beta.6
[INFO] `-- UNMET PEER DEPENDENCY zone.js#^0.6.12
[INFO]
[WARNING] npm WARN EPEERINVALID angular2#2.0.0-beta.17 requires a peer of es6-shim#^0.35.0 but none was installed.
[WARNING] npm WARN EPEERINVALID angular2#2.0.0-beta.17 requires a peer of reflect-metadata#0.1.2 but none was installed.
[WARNING] npm WARN EPEERINVALID angular2#2.0.0-beta.17 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
[WARNING] npm WARN EPEERINVALID angular2#2.0.0-beta.17 requires a peer of zone.js#^0.6.12 but none was installed.
[WARNING] npm WARN EPACKAGEJSON budget_calculator#1.0.0 No description
[WARNING] npm WARN EPACKAGEJSON budget_calculator#1.0.0 No repository field.
[WARNING] npm WARN EPACKAGEJSON budget_calculator#1.0.0 No license field.
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm run build) # BudgetCalculator ---
[INFO] Running 'npm run build' in /Users/csexton/Eclipse-Workspace/REST/BudgetCalculator
[ERROR] npm ERR! Darwin 15.4.0
[ERROR] npm ERR! argv "/Users/csexton/Eclipse-Workspace/REST/BudgetCalculator/node/node" "/Users/csexton/Eclipse-Workspace/REST/BudgetCalculator/node/node_modules/npm/bin/npm-cli.js" "run" "build"
[ERROR] npm ERR! node v5.3.0
[ERROR] npm ERR! npm v3.3.12
[ERROR]
[ERROR] npm ERR! missing script: build
[ERROR] npm ERR!
[ERROR] npm ERR! If you need help, you may report this error at:
[ERROR] npm ERR! <https://github.com/npm/npm/issues>
[ERROR]
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR! /Users/csexton/Eclipse-Workspace/REST/BudgetCalculator/npm-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.356 s
[INFO] Finished at: 2016-05-29T14:36:25-04:00
[INFO] Final Memory: 13M/309M
[INFO] ------------------------------------------------------------------------
two things I can see right off that could be problems but I have no idea how to solve or why it caused the error: npm ERR! missing script: build &
[INFO] +-- UNMET PEER DEPENDENCY es6-shim#^0.35.0
[INFO] +-- UNMET PEER DEPENDENCY reflect-metadata#0.1.2
[INFO] +-- UNMET PEER DEPENDENCY rxjs#5.0.0-beta.6
[INFO] `-- UNMET PEER DEPENDENCY zone.js#^0.6.12
package.json file
{
"name": "budget_calculator",
"version": "1.0.0",
"dependencies": {
"angular2": "2.0.0-beta.17",
"es6-shim":"^0.35.0",
"reflect-metadata":"0.1.2",
"rxjs":"5.0.0-beta.6",
"zone.js":"^0.6.12"
}
}
pom.xml portion of what I used to install plugins
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v5.3.0</nodeVersion>
<npmVersion>3.3.12</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>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

It seems you are missing these dependencies in package.json
"dependencies": {
...
"es6-shim":"^0.35.0",
"reflect-metadata":"0.1.2",
"rxjs":"5.0.0-beta.6",
"zone.js":"^0.6.12"
}
You are also missing a script named build, you can add it in package.json, because in you pom.xml, you have <id>npm run build</id>
{
...
"scripts": {
"build": "..."
},
"dependencies": {
...
}
}

Related

--force option frontend maven plugin

Is there anyway how to use --force option for frontend maven plugin ?
[INFO] --- frontend-maven-plugin:1.12.1:npm (npm install) # justine ---
[INFO] npm ERR! code ERESOLVE
[INFO] npm ERR! ERESOLVE unable to resolve dependency tree
It should look like this :
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --force</arguments>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
</configuration>
</execution>

frontend-maven-plugin fails npm install

I can use the command line to run npm install and npm run build on my project but when I try to use the frontend-maven-plugin it fails with the following error
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] app_name [pom]
[INFO] frontend [jar]
[INFO] backend [jar]
[INFO]
[INFO] ---------------------< com.flareback-domain:app_name >----------------------
[INFO] Building app_name 1.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # app_name ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # app_name ---
[INFO] Installing /Users/flareback/code/app_name/pom.xml to /Users/flareback/.m2/repository/com/flareback-domain/app_name/1.0-SNAPSHOT/app_name-1.0-SNAPSHOT.pom
[INFO]
[INFO] ----------------------< com.flareback-domain:frontend >----------------------
[INFO] Building frontend 1.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # frontend ---
[INFO] Deleting /Users/flareback/code/app_name/frontend/target
[INFO]
[INFO] --- frontend-maven-plugin:1.9.1:install-node-and-npm (install node and npm) # frontend ---
[INFO] Node v12.14.1 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.9.1:npm (npm install) # frontend ---
[INFO] Running 'npm install' in /Users/flareback/code/app_name/frontend
[INFO] internal/modules/cjs/loader.js:796
[INFO] throw err;
[INFO] ^
[INFO]
[INFO] Error: Cannot find module './internal/streams/buffer_list'
[INFO] Require stack:
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/readable-stream/readable.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/log.js
[INFO] - /Users/flareback/code/app_name/frontend/node/node_modules/npm/bin/npm-cli.js
[INFO] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:686:27)
[INFO] at Module.require (internal/modules/cjs/loader.js:848:19)
[INFO] at require (internal/modules/cjs/helpers.js:74:18)
[INFO] at Object.<anonymous> (/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:72:18)
[INFO] at Module._compile (internal/modules/cjs/loader.js:955:30)
[INFO] at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
[INFO] at Module.load (internal/modules/cjs/loader.js:811:32)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:723:14)
[INFO] at Module.require (internal/modules/cjs/loader.js:848:19) {
[INFO] code: 'MODULE_NOT_FOUND',
[INFO] requireStack: [
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/readable-stream/readable.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/node_modules/npmlog/log.js',
[INFO] '/Users/flareback/code/app_name/frontend/node/node_modules/npm/bin/npm-cli.js'
[INFO] ]
[INFO] }
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for app_name 1.0-SNAPSHOT:
[INFO]
[INFO] app_name ........................................... SUCCESS [ 0.279 s]
[INFO] frontend ........................................... FAILURE [ 0.438 s]
[INFO] backend ............................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.902 s
[INFO] Finished at: 2020-02-04T10:34:21-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:npm (npm install) on project frontend: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :frontend
My frontend pom file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>frontend</artifactId>
<parent>
<artifactId>app_name</artifactId>
<groupId>com.flareback-domain</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<frontend-maven-plugin.version>1.9.1</frontend-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.14.1</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I changed my pom to use a different node version
<nodeVersion>v9.11.1</nodeVersion>
I then ran mvn clean install. That failed but it got past the install part and failed on the run build. Then I switched back to <nodeVersion>v12.14.1</nodeVersion> and re-ran the mvn clean install and it worked.
I added node and npm version same as my local machine version then this error disappered
<properties>
<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
<node.version>v12.18.1</node.version>
<npm.version>6.14.5</npm.version>
</properties>
I have this error but my issue is that I added "v" before npm version.
If you get node version, node --version you'll get "v12.3.4" but if you get npm version, you 'll get "5.4.3".
In pom file,
<properties>
<node.version>v16.13.0</node.version>
<npm.version>8.1.0</npm.version> <java.version>11</java.version>
</properties>
I upgraded the Node LTS version and now it works.
It's node version issue. Also possible that your global node version mismatches.
I have implemented following code with node version 10.16.0
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.7.6</version>
<configuration>
<nodeVersion>v10.16.0</nodeVersion>
<npmVersion>6.10.2</npmVersion>
<workingDirectory>./angular</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run-script build</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>
If this still not work, try clearing npm cache with force attribute
npm cache clean --force
Thanks for reading.
Had the same problem. Turn out I just had forgotten to add the 'v' in my node version.
change node version and npm version in the pom file to the node and npm versions that are installed in your local machine. Then run a mvn clean install. It will solve your issue.
This is how i did it.
(1) This is the node and npm versions that are in the project earlier
node - v10.15.2
npm - 6.4.1
(2)This is after i changed the versions
node - v14.19.1
npm - 6.14.16
(3)Then run mvn clean install.
Your problem sould be solved.

How can I launch "bower install" then "spring-boot:run" using Maven?

I'm a studdent and I does not understand something with Maven in my project.
I use spring-boot and angular 1 within the same repository and I need a solution to first execute a "bower install" before using the maven pluggin "spring-boot:run".
I'd to know if it's possible to customize the maven command.
I use IntelliJ and all I do is pressing the start button in my main class
package fr.studionline;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
#EnableAutoConfiguration
public class StudionlineBackApplication {
public static void main(String[] args) {
SpringApplication.run(StudionlineBackApplication.class, args);
}
}
The bower_components directory is in another directory than the main class as described in the picture below :
tree view of my project
Thanks in advance if you can help me understand how it work.
I will respond to any questions if there is something missing in my question.
UPDATE:
I did try the front-end-maven pluggin with this pom configuration :
<build>
<resources>
<resource>
<directory>src/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest released version:
https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>1.4</version>
<executions>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>src/main/resources/static</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
and this was what happend when I execute the command frontend:bower
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building studionline-back 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- frontend-maven-plugin:1.4:bower (default-cli) # studionline-back ---
[INFO] Running 'bower install' in C:\Antoine\Ecole\Projet\ProjetAnu_5A\studionline-back\src\main\resources\static
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.071 s
[INFO] Finished at: 2017-07-06T17:59:58+02:00
[INFO] Final Memory: 11M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-
plugin:1.4:bower
(default-cli) on project studionline-back: Failed to run task: 'bower install' failed.
java.io.IOException:
Cannot run program "C:\Antoine\Ecole\Projet\ProjetAnu_5A\studionline-back\src\main\resources\static\node\node.exe"
(in directory "C:\Antoine\Ecole\Projet\ProjetAnu_5A\studionline-back\src\main\resources\static"):
CreateProcess error=2, Le fichier spécifié est introuvable -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Process finished with exit code 1
But I still doesn't understand how to launch it with Intellij. Should I do mvn run instead of clicking on the "Run" button ?
Have a look at the frontend-maven-plugin. In particular it has a bower runner.
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<!-- optional: The default argument is actually
"install", so unless you need to run some other bower command,
you can remove this whole <configuration> section.
-->
<arguments>install</arguments>
</configuration>
</execution>
Check the "Optional Configuration" section to see how to configure your front end directory. In your case:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- optional -->
<configuration>
<workingDirectory>src/main/resources/static</workingDirectory>
</configuration>
</plugin>

maven release:prepare skips test-jar

I`m using maven ver. 3 with following plugin to generate separated *.jar file with tests.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>core-tests</id>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
and my release plugin configuration looks following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-8</version>
<configuration>
<releaseProfiles>release</releaseProfiles>
<preparationGoals>clean install</preparationGoals>
<generateReleasePoms>false</generateReleasePoms>
<scmCommentPrefix>
release plugin -
</scmCommentPrefix>
</configuration>
</plugin>
Generating test classes in separated jar works fine until I use:
maven clean deploy
When I`m doing release my test-jar is not created:
-Dresume=false release:prepare release:perform
Release output:
...
[INFO] [INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] [INFO] Not compiling test sources
[INFO] [INFO] [surefire:test {execution: default-test}]
[INFO] [INFO] Tests are skipped.
[INFO] [INFO] [jar:jar {execution: default-jar}]
[INFO] [INFO] Building jar: /home/tomcat/hudson_home/jobs/project-core/workspace/target/core-1.2-SNAPSHOT.jar
[INFO] [INFO] [jar:test-jar {execution: core-tests}]
[INFO] [INFO] Skipping packaging of the test-jar
...
I alos tried to use DskipTests but also without success
-Dresume=false -Darguments="-DskipTests" release:prepare release:perform -Prelease
or
-Dresume=false -Darguments="-Dmaven.test.skip.exec=true" release:prepare release:perform -Prelease
How can I generate my test-jar during release? Why it is skipped?
EDIT
I found that this problem occures only when I have active release profile. I can`t find this profile in any parent pom. Where it comes from? From maven-release-plugin definitions?
RESOLVED
I found profile release on hudsons .m2/settings.xml:
<profile>
<id>release</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<username>*****</username>
<password>*****</password>
<skipTests>true</skipTests>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
I just needed to remove maven.test.skip and everything works fine now.

Script to automate the maven release process with SVN source

I am usig a batch script to release my projetcs, it works fine for my common project, but when it comes for the actual main project which got a dependency to the common project, mvn release prepare is failing(Error msg -The svn tag command failed svn: Path(branch path) does not exists in revision# while doing mvn release:prepare).
Batch scrip to release the passed projetcs in sequence
FOR %%G IN (common-utilities-project,myProject) DO (
svn checkout svn://server1/root/%%G/branches/br1
cd br1
call mvn clean
call mvn release:clean
if errorlevel 1 goto failed
call mvn versions:use-next-versions -DgenerateBackupPoms=false -Dincludes=com.commom:common-utilities-project scm:checkin deploy -Dmessage="Updated dependencies for release" -DperformRelease=true
if errorlevel 1 goto failed
echo.| call mvn release:prepare
if errorlevel 1 goto failed
call mvn release:perform -DreleaseProfiles=deploy
if errorlevel 1 goto failed
mvn versions:use-next-snapshots -DallowSnapshots=true -DgenerateBackupPoms=false -Dincludes=com.commom:common-utilities-project scm:checkin deploy -Dmessage="Updated dependencies to SNAPSHOT for next developement"
if errorlevel 1 goto failed
cd..
RD /S/Q br1
)
:failed
echo ******** Unable to do release********
pause
I am using following plugins.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>analyze-report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>classes-jar</id>
<goals><goal>jar</goal></goals>
<phase>package</phase>
<configuration>
<classifier>classes</classifier>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<id>build-exploded-war</id>
<phase>generate-resources</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<useCache>true</useCache>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-maven3-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<ajdtVersion>none</ajdtVersion>
</configuration>
</plugin>
My POM file got the following SCM tag in it.
<scm>
<developerConnection>scm:svn:svn://server1/root/myProject/branches/br1</developerConnection>
<connection>scm:svn:svn://server1/root/myProject/branches/br1</connection>
<url>http://server1</url>
</scm>
Actual error details
...................................A lot of logs with all success......................................
[INFO] [INFO] myProject [Project Module] .............................. SUCCESS [0.140s]
[INFO] [INFO] myProject [WAR module] .................................. SUCCESS [39.043s]
[INFO] [INFO] myProject [EAR module] .................................. SUCCESS [5.874s]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 45.198s
[INFO] [INFO] Finished at: Mon Nov 26 21:59:10 EST 2012
[INFO] [INFO] Final Memory: 26M/63M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file C:\DOCUME~1\u12132\LOCALS~1\Temp\maven-scm-593417731.commit -
-targets C:\DOCUME~1\u12132\LOCALS~1\Temp\maven-scm-5681031475211993765-targets"
[INFO] Working directory: D:\SVN\br1
[INFO] Tagging release with the label myProject-9.9.9...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file C:\DOCUME~1\u12132\LOCALS~1\Temp\maven-scm-917421157.commit --r
evision 33929 svn://server1/root/myProject/branches/br1 svn://server1/root/myProject/tags/myProject-9.9.9"
[INFO] Working directory: D:\SVN\br1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myProject [Project Module] .............................. FAILURE [48.760s]
[INFO] myProject [WAR module] .................................. SKIPPED
[INFO] myProject [EAR module] .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.073s
[INFO] Finished at: Mon Nov 26 21:59:11 EST 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myProject: Unable to t
ag SCM
[ERROR] Provider message:
[ERROR] The svn tag command failed.
[ERROR] Command output:
[ERROR] svn: Path 'svn://server1/root/myProject/branches/br1' does not exist in revision 33929
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
******** Unable to do release********
Press any key to continue . . .
Any comments/idea to improve this script ?
Is the branch given in your SCM tag correct?
scm:svn:svn://server1/root/myProject/branches/br1
Something the release plugin seems to mess it up. I've had to change it manually some times back to a sensible value (depending of the branch from which you do your release).

Resources