You cannot extend Mojos. Also that Mojo has been replaced towards 1.0-beta-1 as it made invalid assumptions about version numbering
There are now much nicer reports... see: dependency-updates-report plugin-updates-report and (the one I am currently writing) property-updates-report Are you sure you need to write your own? 1.0-beta-1 should be being voted on for released in the next 5-10 days... and my plan is assuming a successfuly soak at beta for about 1 month, to release 1.0 in early september... at which point it's ramp up to doxia 1.1, jre 1.5 and maven 2.2.x -Stephen 2009/7/28 Jagannadh <[email protected]> > > Hi, > > We are trying to extend maven-version-plugin as a standalone java > application to get latest available versions. If we run the plugin from > command-line, it works fine but our custom application fails. The following > is what we are trying to do: > > class OurMojo() extends DisplayDependencyUpdatesMojo { > OurMojo(String module) { > super(); > Model model = new Model(); > model.addModule(module); > MavenProject project = new MavenProject(model); > super.setProject(project); > } > ... > // set groupId, artifactId, version, type, classifier, scope > ... > public void execute() throws ... { > VersionRange versionRange = VersionRange.createFromVersionSpec( > version ); > > super.artifactFactory = new DefaultArtifactFactory(); > Artifact artifact = artifactFactory.createDependencyArtifact( groupId, > artifactId, versionRange, type, classifier, scope ); > > ArtifactVersion artifactVersion = findLatestVersion( artifact, > versionRange, null, false ); > System.out.println(artifactVersion); > } > } > > The above code fails at artifactFactory.createDependencyArtifact() with a > NullPointerException. On debug, we reach the following line in > DefaultArtifactFactory: > ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type > ); > However, artifactHandlerManager is never set (or injected) in > DefaultArtifactFactory. > > Any ideas how to get it working? > > We are running the following configuration: > Maven 2.1.0 > maven-version-plugin 1.0-alpha-3 > -- > View this message in context: > http://www.nabble.com/Maven-Plugin-Issue-tp24698071p24698071.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
