Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 76F6018363 for ; Sun, 20 Dec 2015 18:53:47 +0000 (UTC) Received: (qmail 68639 invoked by uid 500); 20 Dec 2015 18:53:47 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 68496 invoked by uid 500); 20 Dec 2015 18:53:47 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 68334 invoked by uid 99); 20 Dec 2015 18:53:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Dec 2015 18:53:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B76E02C1F54 for ; Sun, 20 Dec 2015 18:53:46 +0000 (UTC) Date: Sun, 20 Dec 2015 18:53:46 +0000 (UTC) From: "Hudson (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MSITE-702) Overriding skin resources / Duplicate copying of skin resources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MSITE-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15065873#comment-15065873 ] Hudson commented on MSITE-702: ------------------------------ SUCCESS: Integrated in maven-plugins #4907 (See [https://builds.apache.org/job/maven-plugins/4907/]) [MSITE-702] avoid overriding skin resources / duplicate copying of skin resources (hboutemy: [http://svn.apache.org/viewvc/?view=rev&rev=1721046]) * maven-site-plugin/src/it/resources/src/site/resources/css * maven-site-plugin/src/it/resources/src/site/resources/css/maven-base.css * maven-site-plugin/src/it/resources/verify.groovy > Overriding skin resources / Duplicate copying of skin resources > --------------------------------------------------------------- > > Key: MSITE-702 > URL: https://issues.apache.org/jira/browse/MSITE-702 > Project: Maven Site Plugin > Issue Type: Bug > Affects Versions: 3.3 > Reporter: Andrius Velykis > Fix For: 3.5 > > Attachments: site-resources-test.zip > > > I am trying to override some resources in a Maven site skin by placing files with the same name into my /src/site/resources/ directory. For example, if I were to use the default skin and want to override some file (say css/maven-theme.css), I would create a file /src/site/resources/css/maven-theme.css in my Maven project and generate site with {{mvn site}}. However, in the generated site, the maven-theme.css file from the skin JAR is used rather than my overriding copy. > I was wondering whether this is actually allowed by design in Maven site. I investigated the code and saw some interesting cases there regarding this issue. > In [{{SiteMojo#renderLocale()}}|http://maven.apache.org/plugins/maven-site-plugin/xref/org/apache/maven/plugins/site/SiteMojo.html#151], the site is rendered twice: first with normal resource directories and then with {{generated-site}}. During each rendering ({{siteRenderer.render()}}), all skin resources are copied to the target directory: see [{{DefaultSiteRenderer#copyResources()}}|http://maven.apache.org/doxia/doxia-sitetools/doxia-site-renderer/xref/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.html#728]. After copying the skin resources, the extra site resources from the {{src/site/resources}} directory are copied, overwriting the skin resources. > So in general, the code seems to allow overriding the skin resources with the ones in src/site/resources. However, the double-rendering of the site results in the following steps regarding the overridden file: > 1. maven-theme.css is copied to /target from the skin JAR (normal rendering) > 2. maven-theme.css is overridden from the src/site/resources (normal rendering) <- I want this! > 3. maven-theme.css is AGAIN copied to /target from the skin JAR (generated-site rendering) > 4. resources from target/generated-site/resources are copied to /target/site, however maven-theme.css is not there. (generated-site rendering) > Therefore the 3rd step reverts my override. I could still achieve what I want by having a build step that copies everything from src/site/resources to target/generated-site/resources, which would ensure that my file is the last one copied, but it would be an unnecessary workaround.. > I am thinking that skin files only need to be copied once during the generation process. This would allow overriding files nicely. The second rendering ([{{SiteMojo:191}}|http://maven.apache.org/plugins/maven-site-plugin/xref/org/apache/maven/plugins/site/SiteMojo.html#191]) of the {{generated-site}} sources should not repeat the original process. > Would this be doable? By overriding resource files, it would be possible, for example, to adjust images in the skin without creating and maintaining a new skin. In my case ([Reflow Maven skin|http://andriusvelykis.github.io/reflow-maven-skin/]), I want to allow overriding the Twitter Bootstrap files. I would package the default {{bootstrap.min.css}} with the skin, but the users would be able to override the file with their own configuration. The [Bootstrap customization|http://getbootstrap.com/customize/] or various available themes produce a full bootstrap.min.css file, where it is easier to replace the package skin's version rather than using site.css. site.css could have site-specific customisations, while the theme would be placed in bootstrap.min.css. > I have attached a small Maven site project. I have added src/site/resources/css/maven-theme.css to the resources but in the generated site, the skin's maven-theme.css is still used. -- This message was sent by Atlassian JIRA (v6.3.4#6332)