in src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java [318:415]
private void checkPomRequirements( MavenProject project, DocumentationReporter reporter )
{
checkProjectLicenses( project, reporter );
if ( StringUtils.isEmpty( project.getName() ) )
{
reporter.error( "pom.xml is missing the <name> tag." );
}
if ( StringUtils.isEmpty( project.getDescription() ) )
{
reporter.error( "pom.xml is missing the <description> tag." );
}
if ( StringUtils.isEmpty( project.getUrl() ) )
{
reporter.error( "pom.xml is missing the <url> tag." );
}
else
{
checkURL( project.getUrl(), "project site", reporter );
}
if ( project.getIssueManagement() == null )
{
reporter.error( "pom.xml is missing the <issueManagement> tag." );
}
else
{
IssueManagement issueMngt = project.getIssueManagement();
if ( StringUtils.isEmpty( issueMngt.getUrl() ) )
{
reporter.error( "pom.xml is missing the <url> tag in <issueManagement>." );
}
else
{
checkURL( issueMngt.getUrl(), "Issue Management", reporter );
}
}
if ( project.getPrerequisites() == null )
{
reporter.error( "pom.xml is missing the <prerequisites> tag." );
}
else
{
Prerequisites prereq = project.getPrerequisites();
if ( StringUtils.isEmpty( prereq.getMaven() ) )
{
reporter.error( "pom.xml is missing the <prerequisites>/<maven> tag." );
}
}
if ( StringUtils.isEmpty( project.getInceptionYear() ) )
{
reporter.error( "pom.xml is missing the <inceptionYear> tag." );
}
if ( project.getMailingLists().size() == 0 )
{
reporter.warn( "pom.xml has no <mailingLists>/<mailingList> specified." );
}
if ( project.getScm() == null )
{
reporter.warn( "pom.xml is missing the <scm> tag." );
}
else
{
Scm scm = project.getScm();
if ( StringUtils.isEmpty( scm.getConnection() ) && StringUtils.isEmpty( scm.getDeveloperConnection() )
&& StringUtils.isEmpty( scm.getUrl() ) )
{
reporter.warn( "pom.xml is missing the child tags under the <scm> tag." );
}
else if ( scm.getUrl() != null )
{
checkURL( scm.getUrl(), "scm", reporter );
}
}
if ( project.getOrganization() == null )
{
reporter.error( "pom.xml is missing the <organization> tag." );
}
else
{
Organization org = project.getOrganization();
if ( StringUtils.isEmpty( org.getName() ) )
{
reporter.error( "pom.xml is missing the <organization>/<name> tag." );
}
else if ( org.getUrl() != null )
{
checkURL( org.getUrl(), org.getName() + " site", reporter );
}
}
}