OG failure on Maven 3.1

I’m getting the following error when I try to start up the server which appears to be a Maven 3.1 issue

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.790s
[INFO] Finished at: Tue Nov 26 00:56:07 GMT+08:00 2013
[INFO] Final Memory: 11M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init (default-cli) on project examples-simulated: Execution default-cli of goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init failed: An API incompatibility was encountered while executing com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
[ERROR] —

Googling on “java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()”

Reveals a lot of issues with this API change.

I’ll be fixing this issue, but I just want to give a heads up so that we don’t get into wheel reinvention. If someone else is looking at this let me know ASAP.

Also, I’ve been spending the last few weeks trying to get the cloud servers in HK up and running. It’s pretty close now so once I get that together, I’ll set up buildbot so that there is continuous build of the open source part of OG on different platforms.

The problem seems to me that the maven-plugin is loading version 2.0 of MojoExecutor which doesn’t work with Maven 3.1. Maybe bumping it up to version 2.2 will fix things.

One other question. Are the startup scripts in the 2.2 OG snapshot depreciated. They don’t seem to work because the paths seem to have moved around. If they are supposed to work, I can look into fixing them.

FYI, we use Maven 3.0.5 here. We should ensure it works on 3.1 though.

The scripts only work once a build has been completed. They do not work without running a build. The “-Ddist” option causes the examples projects to generate distribution zip files with correct scripts.

FYI, I put a pull request on OG-Tools and OG-Platform that makes it work with Maven 3.1. It just bumps up the pom.xml files to pull a newer version of Mojo executor. I’ve already sent in the contributor agreement.

Since I’m new to this, if there are any style/logistics issues that you need for me to fix, let me know.

Thanks. We’re just taking a look at it now.

This has been integrated, thanks

Hello,
This issue still applies, for the OG-Tools project. Following the ‘Quick start for developers’ instructions, I just cloned the source from GIT and executed mvn install using maven 3.2.1 and it failed due to API incompatibility issue, as per the original post on this thread, and then same result with maven 3.1.1.

I did manage to build it using maven 3.0.5, which seems to imply that it is the same issue.

Would be glad to help fix it, by upgrading the MojoExecutor version, though this might stop it working with maven 3.0.5

Or, is there a seperate branch of the code targeted to later maven versions?

Update: I have managed to get it to work by upgrading the mojo dependency in og-platform/pom.xml and og-integration/pom.xml to version 2.2

It still builds with maven 3.0.5 as well!
I’ve also had to change the expected value on an Assert from 2 to 1 (in surefire reports under examples-bloomberg).

Happy to pass back my changes if that helps any others who may want to download the source and build.

Can you raise a pull request on GitHub or paste a patch in here please? thanks

Pull request raised - sorry for the delay but it was a rare sunny weekend in London, no coding allowed when the sun comes out (for all of 2.5 hours a year…)
My github handle is antikas.

Please let us know when the fix is in place.

is this related?
mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T12:37:52-05:00)

I get the following lines when running mvn opengamma:server-init -Dconfig=fullstack

[INFO] — opengamma-maven-plugin:1.3.1:server-init (default-cli) @ examples-simulated —
[INFO] Running server initialization: -Dlogback.configurationFile=com/opengamma/util/warn-logback.xml com.opengamma.examples.simulated.tool.ExampleDatabaseCreator classpath:/toolcontext/toolcontext-examplessimulated.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.565 s
[INFO] Finished at: 2014-03-17T17:41:44-05:00
[INFO] Final Memory: 16M/163M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init (default-cli) on project examples-simulated: Execution default-cli of goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init failed: An API incompatibility was encountered while executing com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.opengamma.tools:opengamma-maven-plugin:1.3.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

Yes, this is related. You can get it fixed by using the files in my pull request - from here: https://github.com/OpenGamma/OG-Platform/pulls/antikas

Or use the fork, from here: https://github.com/antikas/OG-Platform

Hope this helps,
Cheers,
Georgios

I pulled from your cloned git repo and it still fails.
[root@fin01 examples-simulated]# mvn opengamma:server-init -Dconfig=fullstack
[INFO] Scanning for projects…
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Examples-Simulated 2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — opengamma-maven-plugin:1.3.1:server-init (default-cli) @ examples-simulated —
[INFO] Running server initialization: -Dlogback.configurationFile=com/opengamma/util/warn-logback.xml com.opengamma.examples.simulated.tool.ExampleDatabaseCreator classpath:/toolcontext/toolcontext-examplessimulated.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.481 s
[INFO] Finished at: 2014-03-18T16:19:34-05:00
[INFO] Final Memory: 16M/163M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init (default-cli) on project examples-simulated: Execution default-cli of goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init failed: An API incompatibility was encountered while executing com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
[ERROR] -----------------------------------------------------

I edited the files manually, I will report the outcome.

I edited according to https://github.com/antikas/OG-Platform/commit/aa683c63e58d33e34cca691290370d71a454077c
but I still get:
mvn install

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:12 min
[INFO] Finished at: 2014-03-18T17:37:44-05:00
[INFO] Final Memory: 41M/264M
[INFO] ------------------------------------------------------------------------
[root@fin01 OG-Platform]# cd examples/
examples-bloomberg/ examples-simulated/ pom.xml
[root@fin01 OG-Platform]# cd examples/examples-simulated/
[root@fin01 examples-simulated]# mvn opengamma:server-init -Dconfig=fullstack
[INFO] Scanning for projects…
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Examples-Simulated 2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — opengamma-maven-plugin:1.3.1:server-init (default-cli) @ examples-simulated —
[INFO] Running server initialization: -Dlogback.configurationFile=com/opengamma/util/warn-logback.xml com.opengamma.examples.simulated.tool.ExampleDatabaseCreator classpath:/toolcontext/toolcontext-examplessimulated.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.423 s
[INFO] Finished at: 2014-03-18T18:07:46-05:00
[INFO] Final Memory: 16M/163M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init (default-cli) on project examples-simulated: Execution default-cli of goal com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init failed: An API incompatibility was encountered while executing com.opengamma.tools:opengamma-maven-plugin:1.3.1:server-init: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
[ERROR] -----------------------------------------------------

I edited:
pom.xml
projects/OG-Integration/pom.xml
mvn clean
mvn install
mvn opengamma:server-init -Dconfig=fullstack

last step fails.

RH 6.5 virtual machine 2CPU 2GB RAM.

This is what I have, I treid changing version to 2.2, 2.0 and 1.1

[root@fin01 .m2]# locate -i mojo
/root/.m2/repository/org/codehaus/mojo
/root/.m2/repository/org/codehaus/mojo/build-helper-maven-plugin
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin
/root/.m2/repository/org/codehaus/mojo/exec-maven-plugin
/root/.m2/repository/org/codehaus/mojo/maven-metadata-central.xml
/root/.m2/repository/org/codehaus/mojo/maven-metadata-central.xml.sha1
/root/.m2/repository/org/codehaus/mojo/mojo-parent
/root/.m2/repository/org/codehaus/mojo/resolver-status.properties
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/_remote.repositories
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.jar
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.jar.lastUpdated
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.jar.sha1
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.pom
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.pom.lastUpdated
/root/.m2/repository/org/codehaus/mojo/buildnumber-maven-plugin/1.1/buildnumber-maven-plugin-1.1.pom.sha1
/root/.m2/repository/org/codehaus/mojo/mojo-parent/28
/root/.m2/repository/org/codehaus/mojo/mojo-parent/30
/root/.m2/repository/org/codehaus/mojo/mojo-parent/30/_remote.repositories
/root/.m2/repository/org/codehaus/mojo/mojo-parent/30/mojo-parent-30.pom
/root/.m2/repository/org/codehaus/mojo/mojo-parent/30/mojo-parent-30.pom.lastUpdated
/root/.m2/repository/org/codehaus/mojo/mojo-parent/30/mojo-parent-30.pom.sha1
/root/.m2/repository/org/twdata/maven/mojo-executor
/root/.m2/repository/org/twdata/maven/mojo-executor-parent
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/_remote.repositories
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.jar
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.jar.lastUpdated
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.jar.sha1
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.pom
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.pom.lastUpdated
/root/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.pom.sha1
/root/.m2/repository/org/twdata/maven/mojo-executor-parent/2.0
/root/.m2/repository/org/twdata/maven/mojo-executor-parent/2.0/_remote.repositories
/root/.m2/repository/org/twdata/maven/mojo-executor-parent/2.0/mojo-executor-parent-2.0.pom
/root/.m2/repository/org/twdata/maven/mojo-executor-parent/2.0/mojo-executor-parent-2.0.pom.lastUpdated
/root/.m2/repository/org/twdata/maven/mojo-executor-parent/2.0/mojo-executor-parent-2.0.pom.sha1

Using maven 3.05 did the trick.