2009/10/22 Brett Porter <[email protected]>: > Well, there's maven-runtime in shared, but that stack dumps on M3 (not sure > if that's a regression or known incompat.) > > Code like this: > > try { > System.out.println( runtime.getProject( Mojo.class ).getVersion() ); > } catch ( MavenRuntimeException e ) { > throw new MojoExecutionException( e.getMessage(), e ); > } > > Error: > > [ERROR] : A required class was missing while executing > test:easy-mojo-plugin:1.0-SNAPSHOT:touch: > org/apache/maven/project/DuplicateProjectException > > I think this is because maven-runtime uses maven-project-2.0.8 as a > dependency, the exceptions thrown by the project sorter API seem to change > over time.
Interesting, I haven't tried maven-runtime on M3. The maven-project dependency is only required for the MavenRuntime.getProject method calls, since they return full MavenProject instances. Try the MavenRuntime.getProjectProperties methods which return the basic GAV info instead. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
