You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alexander Kriegisch <al...@kriegisch.name> on 2024/02/05 04:36:35 UTC

How to completely override/replace parent's site.xml

Neither in [1] nor in [2] I can find a way to completely disregard or override a site.xml from the parent POM. I want to inherit a lot from a specific parent POM, such as dependency management and properties, but not the site.xml. Is there a way to do that?

E.g., [2] seems to imply that if I define my own breadcrumbs, they override the parent's ones, but that is not true. I also cannot eliminate the bannerLeft from the parent, only override it. But I do not want any banner at all. Sorry for asking a maybe simple-minded question like this, but for the life of me, I cannot find the solution using web search, documentation or trial & error.

[1] https://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.html
[2] https://maven.apache.org/plugins/maven-site-plugin/examples/multimodule.html

-- 
Alexander Kriegisch
https://scrum-master.de

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


Re: How to completely override/replace parent's site.xml

Posted by Alexander Kriegisch <al...@kriegisch.name>.
That you avoid it, does not mean that everyone does. It also is not about the parent POM, but the parent site.xml forced upon me. A POM is never a problem, because everything from a POM can be overridden in consuming projects. My question focuses on ways to override things I do not like in site.xml, a case which can also occur within projects of the same organisation. I am still confident that there is a way to override or undefine what I do not need from the site.xml, which is why I asked here. If you do not know, you can just say so. Thanks for your advice to copy things from the parent POM and site I like, I did that already days ago. But it is not what I want, because 99% of the defaults are OK for me. I would not have asked, if this DRY violation would not bug me so much.

-- 
Alexander Kriegisch
https://scrum-master.de


Jörg Schaible schrieb am 07.02.2024 01:24 (GMT +07:00):

> Hi Alexander,
> 
> On Tuesday, 6. February 2024, 02:18:36 CET Alexander Kriegisch wrote:
>> Thanks Jörg,
>> 
>> but that does not answer my question. I do not want to generate a site
>> for the parent. I am talking about the module using the parent POM. BTW,
>> the parent POM is not even under my control, it is from another
>> organisation.
> 
> OK, this is something I absolutely avoid. Typically I have a standalone parent 
> for the company/entity/whatever that can be used for all projects sharing 
> global stuff like emails, SCM URLs, URLs for distributions sites, versions, 
> etc. And it is a great place for profile definitions with preconfigured plugins
> 
> to build all kind of artifact types relevant for your entity.
> 
>> I am consuming it, because I like the defaults for plugin
>> and dependency versions and configurations.
> 
> If I really need something, I copy it over and adjust it to our naming 
> conventions. Always keep control of your own build.
> 
> I know that projects like spring-boot give a different advice, but typically 
> you're then left alone with all the other configuration stuff. Then you will 
> have to add entries to your own POMs everywhere e.g. for deployment, 
> distribution, etc. and cannot use properties for the shared stuff like domains 
> in emails, all kind of URLs. Maintenance is getting harder, if something of 
> this changes.
> 
>> Only the site.xml annoys me.
>> I do not want their menu structure and logo in my app's Maven site. The
>> problem is, as I described: I do not know how to use the parent POM
>> without also being forced to use the paren site.xml, which is attached
>> to the artifact. This inheritance is nice, but I need a way to avoid,
>> override or overrule it and make Maven Site Plugin use my own site.xml
>> exclusively.
> 
> No help for this case, sorry.
> 
> Regards,
> Jörg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: How to completely override/replace parent's site.xml

Posted by Jörg Schaible <jo...@gmx.de.INVALID>.
Hi Alexander,

On Tuesday, 6. February 2024, 02:18:36 CET Alexander Kriegisch wrote:
> Thanks Jörg,
> 
> but that does not answer my question. I do not want to generate a site
> for the parent. I am talking about the module using the parent POM. BTW,
> the parent POM is not even under my control, it is from another
> organisation.

OK, this is something I absolutely avoid. Typically I have a standalone parent 
for the company/entity/whatever that can be used for all projects sharing 
global stuff like emails, SCM URLs, URLs for distributions sites, versions, 
etc. And it is a great place for profile definitions with preconfigured plugins 
to build all kind of artifact types relevant for your entity.

> I am consuming it, because I like the defaults for plugin
> and dependency versions and configurations.

If I really need something, I copy it over and adjust it to our naming 
conventions. Always keep control of your own build.

I know that projects like spring-boot give a different advice, but typically 
you're then left alone with all the other configuration stuff. Then you will 
have to add entries to your own POMs everywhere e.g. for deployment, 
distribution, etc. and cannot use properties for the shared stuff like domains 
in emails, all kind of URLs. Maintenance is getting harder, if something of 
this changes.

> Only the site.xml annoys me.
> I do not want their menu structure and logo in my app's Maven site. The
> problem is, as I described: I do not know how to use the parent POM
> without also being forced to use the paren site.xml, which is attached
> to the artifact. This inheritance is nice, but I need a way to avoid,
> override or overrule it and make Maven Site Plugin use my own site.xml
> exclusively.

No help for this case, sorry.

Regards,
Jörg



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


Re: How to completely override/replace parent's site.xml

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Thanks Jörg,

but that does not answer my question. I do not want to generate a site
for the parent. I am talking about the module using the parent POM. BTW,
the parent POM is not even under my control, it is from another
organisation. I am consuming it, because I like the defaults for plugin
and dependency versions and configurations. Only the site.xml annoys me.
I do not want their menu structure and logo in my app's Maven site. The
problem is, as I described: I do not know how to use the parent POM
without also being forced to use the paren site.xml, which is attached
to the artifact. This inheritance is nice, but I need a way to avoid,
override or overrule it and make Maven Site Plugin use my own site.xml
exclusively.

-- 
Alexander Kriegisch
https://scrum-master.de


Jörg Schaible schrieb am 06.02.2024 05:04 (GMT +07:00):

> Hi Alexander,
> 
> On Monday, 5. February 2024, 05:36:35 schrieb Alexander Kriegisch wrote:
>> Neither in [1] nor in [2] I can find a way to completely disregard or
>> override a site.xml from the parent POM. I want to inherit a lot from a
>> specific parent POM, such as dependency management and properties, but not
>> the site.xml. Is there a way to do that?
>> 
>> E.g., [2] seems to imply that if I define my own breadcrumbs, they override
>> the parent's ones, but that is not true. I also cannot eliminate the
>> bannerLeft from the parent, only override it. But I do not want any banner
>> at all. Sorry for asking a maybe simple-minded question like this, but for
>> the life of me, I cannot find the solution using web search, documentation
>> or trial & error.
>> 
>> [1]
>> https://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.
>> html [2]
>> https://maven.apache.org/plugins/maven-site-plugin/examples/multimodule.htm
>> l
> 
> You can achieve a separate site generation for the parent only by using a 
> profile and an own site directory:
> 
> 1/ use src/site-parent in the parent pom's project for its site content
> 2/ define a profile that us automatically activated id the directory src/site-
> parent exists
> 3/ configure the site plugin's siteDirectory parameter to use src/site-parent
> 
> The trick is that the profile is automatically enabled, when you build the 
> parent project, but it is never active in any other project, since none has an 
> existing src/site-parent directory.
> 
> Regards,
> Jörg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: How to completely override/replace parent's site.xml

Posted by Jörg Schaible <jo...@gmx.de.INVALID>.
Hi Alexander,

On Monday, 5. February 2024, 05:36:35 schrieb Alexander Kriegisch wrote:
> Neither in [1] nor in [2] I can find a way to completely disregard or
> override a site.xml from the parent POM. I want to inherit a lot from a
> specific parent POM, such as dependency management and properties, but not
> the site.xml. Is there a way to do that?
> 
> E.g., [2] seems to imply that if I define my own breadcrumbs, they override
> the parent's ones, but that is not true. I also cannot eliminate the
> bannerLeft from the parent, only override it. But I do not want any banner
> at all. Sorry for asking a maybe simple-minded question like this, but for
> the life of me, I cannot find the solution using web search, documentation
> or trial & error.
> 
> [1]
> https://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.
> html [2]
> https://maven.apache.org/plugins/maven-site-plugin/examples/multimodule.htm
> l

You can achieve a separate site generation for the parent only by using a 
profile and an own site directory:

1/ use src/site-parent in the parent pom's project for its site content
2/ define a profile that us automatically activated id the directory src/site-
parent exists
3/ configure the site plugin's siteDirectory parameter to use src/site-parent

The trick is that the profile is automatically enabled, when you build the 
parent project, but it is never active in any other project, since none has an 
existing src/site-parent directory.

Regards,
Jörg



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


Re: How to completely override/replace parent's site.xml

Posted by Alexander Kriegisch <al...@kriegisch.name>.
For the record: The correct answer to my question seems to be, that it
is simply not possible. Hence, I created
https://issues.apache.org/jira/browse/DOXIASITETOOLS-330.

-- 
Alexander Kriegisch
https://scrum-master.de


Alexander Kriegisch schrieb am 05.02.2024 11:36 (GMT +07:00):

> Neither in [1] nor in [2] I can find a way to completely disregard or override
> a site.xml from the parent POM. I want to inherit a lot from a specific parent
> POM, such as dependency management and properties, but not the site.xml. Is
> there a way to do that?
> 
> E.g., [2] seems to imply that if I define my own breadcrumbs, they override the
> parent's ones, but that is not true. I also cannot eliminate the bannerLeft
> from the parent, only override it. But I do not want any banner at all. Sorry
> for asking a maybe simple-minded question like this, but for the life of me, I
> cannot find the solution using web search, documentation or trial & error.
> 
> [1]
> https://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.html
> [2]
> https://maven.apache.org/plugins/maven-site-plugin/examples/multimodule.html
> 
> -- 
> Alexander Kriegisch
> https://scrum-master.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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