maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rolf Schmidiger" <rolf.schmidi...@tele2.ch>
Subject Accessing Maven's Project descriptor "outside" Maven - how?
Date Thu, 07 Oct 2004 18:47:41 GMT
Hello maven-ers

I'm currently writing a Doclet which generates a XML Descriptor of the Java
Sources (and a Javadoc PDF using FOP). Now i want to include some Maven
properties from the project.xml.

I have used:

  Project prj = new Project();
  prj.setFile(mavenDescriptor);
  try {
   	prj.initialize();
  } catch (Exception ex) {
      ex.printStackTrace();
  }
  System.out.println("CURRENT VERSION:" + prj.getCurrentVersion());

I get a NPE:

    [javadoc] java.lang.NullPointerException
    [javadoc]   at
org.apache.maven.ArtifactListBuilder.build(ArtifactListBuilder.java:53)
    [javadoc]   at
org.apache.maven.project.Project.buildArtifactList(Project.java:1405)
    [javadoc]   at
org.apache.maven.project.Project.initialize(Project.java:1339)
    [javadoc]   at
ch.rsmnet.javadoc2xml.doclet.RootDocHandler.<init>(RootDocHandler.java:61)
    [javadoc]   at
ch.rsmnet.javadoc2xml.doclet.XMLDoclet.<init>(XMLDoclet.java:67)
    [javadoc]   at
ch.rsmnet.javadoc2xml.doclet.XMLDoclet.start(XMLDoclet.java:116)
    [javadoc]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
.....

Any ideas? Wrong way to do this ? (btw: maven-1.0.jar is used)

Thanks for help
Cheers
Rolf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message