Skip to content

[DOXIASITETOOLS-348] Allow to enforce a parent site descriptor #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

kwin
Copy link
Member

@kwin kwin commented Sep 19, 2024

No description provided.

@kwin kwin requested a review from michael-o September 19, 2024 17:16
<description><![CDATA[
Whether to enforce a parent site descriptor.
]]></description>
<name>enforceParentDescriptor</name>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is really a good name, any other suggestion?

Copy link
Member

@michael-o michael-o Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of enforce I'd use the term require. E.g., requireParentSite. The term descriptor is too confusing and too abstract for most.

@@ -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.
Copy link
Member Author

@kwin kwin Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably outline that this is only effective in case the the POM has a parent defined. Also this just requires a parent descriptor on any level (not necessarily from the direct parent).

@michael-o
Copy link
Member

I have a few thoughts on this, will try to share tomorrow or over the weekend.

@kwin kwin force-pushed the feature/enforce-parent-site-descriptor branch from bd5647d to 4bdef85 Compare September 20, 2024 06:37
@michael-o
Copy link
Member

Looking at your usecase I have the feeling that we have a conceptual flaw in our design. Implicit parents do not seem right after all and you are trying to remedy this with a parameter at the wrong place IMHO. I think that we either need something like:

<site>
  <parent>
    <groupId>com.mycompany.app</groupId>
    <artifactId>my-app</artifactId>
    <version>1</version>
  </parent>
</site>

(type and classifier are implied)

or we can make the site.xml a provided dependency of our build in the POM directly. If the site descriptor follows the rules of the POM then introducing a parent seems natural to me, no?

See this one: https://repo1.maven.org/maven2/org/apache/maven/maven-parent/43/maven-parent-43-site.xml

Either:

<site>
  <parent>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-parent</artifactId>
    <version>43</version>
  </parent>
</site>

OR

<project>
<dependencies>
  <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-parent</artifactId>
    <version>43</version>
    <type>xml</type>
    <classifier>site</classifer>
  </dependency>
</dependencies>
</site>

WDYT?

@kwin
Copy link
Member Author

kwin commented Sep 20, 2024

we have a conceptual flaw in our design

Yes, but I am trying to fix this without breaking backwards compatibility.

Having an additional parent on the site.xml level would fix this, but in most cases is highly redundant (and also isn't properly upgraded during release), so maintaining this on site.xml level would lead to a lot of additional challenges.

Similar an additional dependency on the POM level feels highly redundant, because this should always reflect the Maven coordinates of the parent. Also knowledge about classifier (potentially extended with locale) requires additional knowledge from consumers they shouldn't necessarily know about.

So just having a boolean toggle is IMHO the option with least redundancy and simplest to understand from a consumer PoV.

@michael-o
Copy link
Member

we have a conceptual flaw in our design

Yes, but I am trying to fix this without breaking backwards compatibility.

Having an additional parent on the site.xml level would fix this, but in most cases is highly redundant (and also isn't properly upgraded during release), so maintaining this on site.xml level would lead to a lot of additional challenges.

Similar an additional dependency on the POM level feels highly redundant, because this should always reflect the Maven coordinates of the parent. Also knowledge about classifier (potentially extended with locale) requires additional knowledge from consumers they shouldn't necessarily know about.

So just having a boolean toggle is IMHO the option with least redundancy and simplest to understand from a consumer PoV.

Let me crunch on this...I am we are already breaking stuff. This would be ideal for now because we won't have another chance soon to break it.

<description><![CDATA[
Whether to enforce a parent site descriptor.
]]></description>
<name>enforceParentDescriptor</name>
Copy link
Member

@michael-o michael-o Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of enforce I'd use the term require. E.g., requireParentSite. The term descriptor is too confusing and too abstract for most.

@kwin kwin force-pushed the feature/enforce-parent-site-descriptor branch from 4bdef85 to 5f7d799 Compare September 24, 2024 12:41
@kwin kwin requested a review from michael-o September 24, 2024 12:41
Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is a compromise...let's move on.

This leads to build failures in case it is required but cannot be
resolved.
@kwin kwin force-pushed the feature/enforce-parent-site-descriptor branch from 5f7d799 to 3228dc8 Compare September 24, 2024 18:25
@kwin kwin marked this pull request as ready for review September 24, 2024 18:27
@kwin kwin merged commit 004b948 into master Sep 24, 2024
36 checks passed
@kwin kwin deleted the feature/enforce-parent-site-descriptor branch September 24, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants