[ https://issues.apache.org/jira/browse/DOXIASITETOOLS-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17884042#comment-17884042 ]
ASF GitHub Bot commented on DOXIASITETOOLS-348: ----------------------------------------------- michael-o commented on code in PR #173: URL: https://github.com/apache/maven-doxia-sitetools/pull/173#discussion_r1771964660 ########## doxia-site-model/src/main/mdo/site.mdo: ########## @@ -66,6 +66,15 @@ under the License. <type>String</type> <defaultValue>merge</defaultValue> </field> + <field xml.attribute="true"> + <description><![CDATA[ + Whether to enforce a parent site descriptor. + ]]></description> + <name>enforceParentDescriptor</name> Review Comment: Instead of `enforce` I'd use the term `requre`. E.g., `requireParentSite`. The term `descriptor` is too confusing and too abstract for most. ########## doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java: ########## @@ -70,46 +66,16 @@ @PlexusTest public class SiteToolTest { - @Inject - private PlexusContainer container; - - @Inject - private ArtifactRepositoryFactory artifactRepositoryFactory; - - @Inject - @Named("default") - private ArtifactRepositoryLayout defaultArtifactRepositoryLayout; - @Inject private DefaultSiteTool tool; - /** - * @return the repo. - * - * @throws Exception - */ - protected ArtifactRepository getLocalRepo() throws Exception { - String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS; - String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN; - ArtifactRepositoryPolicy snapshotsPolicy = - new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag); - ArtifactRepositoryPolicy releasesPolicy = - new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag); - return artifactRepositoryFactory.createArtifactRepository( - "local", - getTestFile("target/local-repo").toURI().toURL().toString(), - defaultArtifactRepositoryLayout, - snapshotsPolicy, - releasesPolicy); - } - Review Comment: Accepted. > Extend site descriptor to enforce a parent > ------------------------------------------ > > Key: DOXIASITETOOLS-348 > URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-348 > Project: Maven Doxia Sitetools > Issue Type: Improvement > Components: Site model > Affects Versions: 2.0.0-M19 > Reporter: Konrad Windszus > Assignee: Konrad Windszus > Priority: Major > > Currently the [site > descriptor|https://maven.apache.org/doxia/doxia-sitetools/doxia-site-model/site.html] > does not allow to enforce a parent {{site.xml}}. > The attribute {{combine.self}} does not lead to a failure in case no parent > {{site.xml}} can be found. > This may easily lead to broken sites without breaking the site build as > a) the site transparently inherits the {{site.xml}} attached to the parent > POM. > b) attaching the {{site.xml}} to a project is a manual step > (https://maven.apache.org/plugins/maven-site-plugin/attach-descriptor-mojo.html) > As at the time when the descriptor of the derived {{site.xml}} is created it > is known whether the descriptor works standalone or requires a parent > {{site.xml}}, therefore this should be made explicit in the site descriptor. > I propose to add an additional attribute {{requireParent}} on the top level > element which is {{false}} by default (current behaviour). If set to {{true}} > it should lead to a build failure in case the parent {{site.xml}} cannot be > resolved (for whatever reason). -- This message was sent by Atlassian Jira (v8.20.10#820010)