public ArchivaProjectModel read( File pomFile )
throws ProjectModelException
{
try
{
XMLReader xml = new XMLReader( "project", pomFile );
ArchivaProjectModel model = new ArchivaProjectModel();
xml.removeNamespaces();
Element project = xml.getElement( "//project" );
// TODO: Handle <extend /> ?? (is this even possible?)
model.setGroupId( project.elementTextTrim( "groupId" ) );
model.setArtifactId( project.elementTextTrim( "artifactId" ) );
// TODO: Handle <id />
model.setVersion( project.elementTextTrim( "currentVersion" ) );
model.setName( project.elementTextTrim( "name" ) );
model.setDescription( project.elementTextTrim( "description" ) );
// TODO: what to do with <shortDescription /> ?
model.setUrl( project.elementTextTrim( "url" ) );
// TODO: Handle <logo />
// TODO: Handle <inceptionYear />
model.setIssueManagement( getIssueManagement( xml ) );
// TODO: What to do with <gumpRepositoryId /> ?
// TODO: Handle <siteAddress />
// TODO: Handle <siteDirectory /> ?
// TODO: Handle <distributionSite />
// TODO: Handle <distributionDirectory />
model.setMailingLists( getMailingLists( xml ) );
model.setIndividuals( getIndividuals( xml ) );
model.setLicenses( getLicenses( xml ) );
model.setReports( getReports( xml ) );
model.setRepositories( getRepositories( xml ) );
model.setScm( getSCM( xml ) );
model.setOrganization( getOrganization( xml ) );
model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) );
model.setDependencies( getDependencies( xml ) );
/* Following are not valid for <pomVersion>3</pomVersion> / Maven 1 pom files.
*
* model.setDependencyManagement()