Friday, February 21, 2014

release:prepare - You don't have a SNAPSHOT project in the reactor projects list.

Sometimes during executing mvn release:prepare following error ocures:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.995s
[INFO] Finished at: Fri Feb 21 11:19:01 CET 2014
[INFO] Final Memory: 11M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project cubiculus-ldraw: You don't have a SNAPSHOT project in the reactor projects list. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project [project-name]: You don't have a SNAPSHOT project in the reactor projects list.

In other words it say that your pom.xml file is not in SNAPSHOT version (for example 1.4-SNAPSHOT) but contains release version (for example 1.4.3). One to the reasons of this problem could be that previous attempt to release project failed and during it's work changed project version to release version. Check your repository that there is correct SNAPSHOT versions and synchronise repo. In case of SVN "svn revert -R ."

Maven release - svn problem

I have met following problem during releasing of maven project.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.759s
[INFO] Finished at: Fri Feb 21 09:26:53 CET 2014
[INFO] Final Memory: 12M/191M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project [project_name]: Unable to check for local modifications
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: The path '.' appears to be part of a Subversion 1.7 or greater
[ERROR] working copy.  Please upgrade your Subversion client to use this
[ERROR] working copy.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project [project_name]: Unable to check for local modifications
Provider message:
The svn command failed.
Command output:
svn: The path '.' appears to be part of a Subversion 1.7 or greater
working copy.  Please upgrade your Subversion client to use this
working copy.

 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
 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.buildProject(LifecycleModuleBuilder.java:84)
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to check for local modifications

Previous problem is caused by SVN client version incompatibility. Project was probably checkout from repository in Eclipse and maven release prepare command was run from command line. At command line is client version 1.6. This is problem. There are few ways how to solve it:

  • Easiest solution is to perform subversion related operation with console. Some basic examples with description could be found here.
  • Command line subversion client could be updated to version 1.7
  • In eclipse is plugin which is responsible for subversion handling. It's in eclipse configuration in "Team" and there in "SVN". There is list of available SVN client libraries. There could be selected at least "SVNKit" and "JavaHL JNI". You can try to install correct version of JavaHL of find correct SVNKit version. This both approaches are well described at google.

SVN repository - basic

Access to SVN repository is common way how to share files across team. Basic project structure look like:
<project name>
   |-- branches
   |-- tags
   `-- trunk
      |-- src
      |   `-- main
      |      `-- java
      `-- pom.xml

Project itself is stored in directory trunk. Directory tags is used for fixing released project versions. It's useful for further bugfixing. Directory branches is used for project versions. For example there could be feature branche.

Checkout

For checkout project form repository is command

svn co <repo>/trunk/<module> <target-directory> --username <your_username>

I my case it could look like:

svn co https://svn.code.sf.net/p/cubiculus/code/cubiculus-ldraw/trunk .

Revert

When it necessary to overwrite local changes with --HEAD from repository following should by used:

svn revert -R 

Revert is by default not recursive because of that svn have to by instruct by -R to perform reverting recursively.

For more information try to one of this links.

Wednesday, February 12, 2014

Upload file with SCP

linux command scp is tool for uploading files over ssh. For simple uploading file from local file to remote host could be used this:

scp ~/Downloads/apache-tomcat-7.0.50.tar.gz karel@123.17.131.12:/home/karel/

Previous command will upload apache tomcat install file from local Download directory to remote home of user karel. User will be asked for karel's password.

Than login to remote server as user karel and finally extract apache server in a following way:

tar -zxvf apache-tomcat-7.0.50.tar.gz

And it's done.

Monday, February 10, 2014

Camel error - No component found with scheme: stream

During Camel startup I found following exception:

2014-02-10 09:18:51 - Context initialization failed
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[stream:out] <<< in route: Route(route1)[[From[file:src/data?noop=true]] -> [ConvertBod... because of Failed to resolve endpoint: stream://out due to: No component found with scheme: stream

The problem is in missing dependency to library that contains stream:out endpoint. In maven it should look like:

<dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-stream</artifactId>
 <version>${camel-version}</version>
</dependency>

Value of camel-version should be same as camel-core version.