Saad Bhutto Saad Bhutto - 3 months ago 33
Java Question

floreant POS : error in building jar file using maven

I have downloaded source code of FLOREANT POS from official site, and tried to built the project using maven. It requires two Commands mvn clean & mvn pacakage , when I tried to use these it gives me following error

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.3:cr
eate (default) on project floreantpos: Cannot get the revision information from
the scm repository :
[ERROR] Exception while executing SCM command. svn: E155007: 'E:\POS\floreantpos
-code-452-trunk' is not a working copy
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:buildnumber-maven-plugin:1.3:create (default) on project florea
ntpos: Cannot get the revision information from the scm repository :
Exception while executing SCM command.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot get the revisi
on information from the scm repository :
Exception while executing SCM command.
at org.codehaus.mojo.build.CreateMojo.getRevision(CreateMojo.java:785)
at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:465)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
... 20 more
Caused by: org.apache.maven.scm.ScmException: Exception while executing SCM comm
and.
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.
java:63)
at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeComma
nd(AbstractSvnScmProvider.java:388)
at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(Abstrac
tSvnScmProvider.java:411)
at org.codehaus.mojo.build.CreateMojo.info(CreateMojo.java:818)
at org.codehaus.mojo.build.CreateMojo.getRevision(CreateMojo.java:754)
... 23 more
Caused by: org.apache.maven.scm.ScmException: svn: E155007: 'E:\POS\floreantpos-
code-452-trunk' is not a working copy
at org.apache.maven.scm.provider.svn.svnjava.command.info.SvnJavaInfoCom
mand.executeSingleInfoCommand(SvnJavaInfoCommand.java:110)
at org.apache.maven.scm.provider.svn.svnjava.command.info.SvnJavaInfoCom
mand.executeInfoCommand(SvnJavaInfoCommand.java:71)
at org.apache.maven.scm.provider.svn.svnjava.command.info.SvnJavaInfoCom
mand.executeCommand(SvnJavaInfoCommand.java:48)
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.
java:59)
... 27 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E155007: 'E:\POS\floreantpo
s-code-452-trunk' is not a working copy
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorMana
ger.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorMana
ger.java:51)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.parseDir(SVNWCDb.java
:1886)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.parseDir(SVNWCDb.java
:1777)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.readConflicts(SVNWCDb
.java:3308)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.readConflicts(SVNWCDb
.java:3281)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.opReadTreeConflict(SV
NWCDb.java:2723)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetInfo.run(SvnNgGetInfo.
java:72)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetInfo.run(SvnNgGetInfo.
java:51)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNg
OperationRunner.java:20)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperati
onRunner.java:20)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactor
y.java:1149)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.wc.SVNWCClient.doInfo(SVNWCClient.java:2485)
at org.apache.maven.scm.provider.svn.svnjava.command.info.SvnJavaInfoCom
mand.executeSingleInfoCommand(SvnJavaInfoCommand.java:88)
... 30 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception


enter image description here

and here is my POM.xml File

<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.floreantpos</groupId>
<artifactId>floreantpos</artifactId>
<version>1.4-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<scm>
<connection>scm:svn:http://svn.code.sf.net/p/floreantpos/code/trunk</connection>
</scm>

<build>
<sourceDirectory>src</sourceDirectory>
<finalName>floreantpos</finalName>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>resources</directory>
</resource>
<resource>
<directory>filters</directory>
<filtering>true</filtering>
<includes>
<include>*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<providerImplementations>
<svn>javasvn</svn>
</providerImplementations>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
<artifactId>maven-scm-provider-svnjava</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.floreantpos.main.Main</mainClass>
</manifest>
<manifestEntries>
<Class-Path>config/ i18n/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptor>resources/META-INF/mvn-assembly.xml</descriptor>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>prepare</id>
<phase>validate</phase>
<configuration>
<target>
<echo message="prepare phase" />
<unzip src="database/derby-server/posdb.zip" dest="${project.build.directory}" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>package</phase>
<configuration>
<target>
<zip destfile="${project.build.directory}/${project.build.finalName}-1.4-build${buildNumber}.zip" basedir="${project.build.directory}/${project.build.finalName}-bin/${project.build.finalName}"></zip>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>
[1.6,)
</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>

<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>ecs</groupId>
<artifactId>ecs</artifactId>
<version>1.4.2</version>
</dependency>

<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.4.0</version>
</dependency>

<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>

<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swingx-core</artifactId>
<version>1.6.2-2</version>
</dependency>

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.8.1.2</version>
</dependency>

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbynet</artifactId>
<version>10.8.1.2</version>
</dependency>

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.8.1.2</version>
</dependency>

<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>looks</artifactId>
<version>2.2.2</version>
</dependency>

<dependency>
<groupId>com.intellij</groupId>
<artifactId>forms_rt</artifactId>
<version>7.0.3</version>
</dependency>

<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.0.1</version>
<exclusions>
<exclusion>
<artifactId>itext</artifactId>
<groupId>com.lowagie</groupId>
</exclusion>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>foxtrot</groupId>
<artifactId>foxtrot</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swing-layout</artifactId>
<version>1.0.3</version>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>

<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.2</version>
<exclusions>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<artifactId>mail</artifactId>
<groupId>javax.mail</groupId>
</exclusion>
<exclusion>
<artifactId>jms</artifactId>
<groupId>javax.jms</groupId>
</exclusion>
<exclusion>
<artifactId>jmxtools</artifactId>
<groupId>com.sun.jdmk</groupId>
</exclusion>
<exclusion>
<artifactId>jmxri</artifactId>
<groupId>com.sun.jmx</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>jpos</groupId>
<artifactId>jpos</artifactId>
<version>110</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jpos</groupId>
<artifactId>jpos-controls</artifactId>
<version>110</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.metawidget.modules</groupId>
<artifactId>metawidget-all</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>net.xeoh</groupId>
<artifactId>jspf.core</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>net.authorize</groupId>
<artifactId>anet-java-sdk</artifactId>
<version>1.8.1</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
</dependency>

<dependency>
<groupId>com.jidesoft</groupId>
<artifactId>jide-oss</artifactId>
<version>3.6.1</version>
</dependency>

<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>

<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>

<dependency>
<groupId>us.fatehi</groupId>
<artifactId>magnetictrackparser</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
</dependencies>

<repositories>
<repository>
<id>local-repo</id>
<url>file://${project.basedir}/local-lib</url>
</repository>
</repositories>

</project>


I am not sure either its a plugin dependency error OR my Code Error

thanks in advance

Answer

You did a download of the sources, not a checkout from the tag. For that reason the buildnumber-maven-plugin can't detect the revision number. In this case it should be good enough to skip it by adding -Dmaven.buildNumber.skip to the commandline arguments, based of skip docs.