Where is the site.vm of the maven-default-skin? - maven

When I run mvn site with no site.xml on a simple Maven project (meaning it will use the maven-default-skin) which site.vm file site used?
I have looked into maven-site-plugin, maven-project-info-reports-plugin, maven-doxia-sitetools and of course maven-default-skin, but I could not find it anywhere.
For the maven-fluido-skin, I can find the site.vm in src/main/resources/META-INF/maven. But there is no such file for maven-default-skin.

When using maven-site-plugin 4.0.0-M3, the maven-doxia-sitetools version used is 2.0.0-M3. This version provides the default-site.vm file in its resources, which is used as the default template in the DefaultSiteRenderer class if the skin doesn't provide any (e.g. maven-default-skin).
In maven-site-plugin 4.0.0-M4, the version of maven-doxia-sitetools is 2.0.0-M4. In this version, the default-site.vm has been removed and the default skin has been changed to maven-fluido-skin.
This means it's not possible anymore to use a skin that doesn't provide the site.vm template. If one tries to force the use of the maven-default-skin with version 4.0.0-M4, it will fail with the message Skin does not contain template at META-INF/maven/site.vm.
This change has been done in https://issues.apache.org/jira/browse/DOXIASITETOOLS-270. maven-default-skin is unmaintained and will be replaced by maven-fluido-skin, see https://issues.apache.org/jira/browse/MSKINS-196.
For information, the site.vm is a Velocity template file and is rendered by maven-doxia-sitetools (doxia-site-renderer to be precise) on maven-site-plugin's request.

Related

How to add prefix in URI while loading XQuery file using ml-gradle

I am using gradle 6.8 and MarkLogic version is 10.0-5.2,
My XQuery code is in directory \ml-gradle\src\main\common. When I run the command mlLoadModules to load XQuery into the modules database it loads with default URI /common/test.xqy.
I want to add some prefix to the URIs e.g. /rsc/common/test.xqy. How can I achieve that?
Note: I don't want to create an extra folder in my source for prefix "rsc".
It's not supported, though you could write a custom Gradle task to change the URI to whatever you like.
Why do you not want to create an "rsc" folder above "common"? I think other developers would find it much more intuitive that "rsc/common/test.xqy" becomes "/rsc/common/test.xqy" when loaded, rather than "common/test.xqy" becomes "rsc/common/test.xqy", which begs the question - where is "rsc" coming from? And then that developer would need to understand what property / custom code is adding that "rsc".

Wro4j image to datauri conversion in build-time

is it possible to convert via wro4j maven plugin imported into css image to uridata in build time? I see on their wiki run-time solution but I would like to have static files already converted. Or maybe somebody knows another plugin which can do this?
There is virtually no difference between run-time solution and build time solution in wro4j. The CssDataUriPreProcessor is responsible for converting image url's into css data uri. In order to use it with maven plugin, just add this processor to the list of processors to be applied. Example:
preProcessors=cssImport,cssDataUri,jsMin,cssMin
Notice the "cssDataUri" alais in the list of configured pre processors. Once added, it should be applied for each pre processed resource.

Property Replacement in Maven Site Content

I'm generating maven site content using the site plugin. I want to have a little table that shows my maven group id, artifact id, parent info, etc on the module. I don't see a plugin for it, so I was going to use the APT format and create a content page with a table for it. The documentation says I can use property replacement in the site descriptor via ${project.name} etc. This fails when i use it in both the descriptor and in my index.apt file. Has anybody seen this done or know how to do it?
The mvn site command generates a Project Summary page which has this information on it. Does that work for you?
For example, when I execute mvn site, get an output here target/site/project-summary.html where the page has a section like so:
Build Information
Field Value
GroupId com.a.b
ArtifactId myapp
Version 1.01.13-SNAPSHOT
Type jar
If you want to create pages which use placeholder like ${project.version} etc. you need to use index.apt.vm (velocity files) wher the replacement works. But for the information you have asked the solution which has been described (project-summary.html) is the right way cause it's automatically generated.

Editing velocity template of Liferay changes not showing or takes a while

I'm currently editing my portal_normal.vm (server/tomcat/webapps/mytheme-theme/templates) testing if I can write on the file and see it on my browser. I tried putting a test comment "<!-- test -->" just to see if I can really write on the file. So I refreshed the file and hope I can see the comment I've added, but there we're none. So I continued refreshing (ctrl+r),\ and viewing the source code for almost an twenty minutes. After a while when I tried viewing it again it reflected in my source code. So I thought it was cached by either Liferay or my browser.
So I tried tweaking the comment adding version on it ("<!-- test v2 -->"), hoping to see changes. I checked it on another browser and the comment didn't update or include my added version. So I think Liferay is responsible for the issue.
this is what my portal-ext.properties contain:
auth.token.check.enabled=false
# Database settings
jdbc.default.jndi.name=jdbc/LiferayPool
#For removing captch
captcha.check.portal.create_account=false
session.enable.phishing.protection=false
default.regular.theme.id=my_site_WAR_my_theme
#Delete cookies while deleting session
session.enable.persistent.cookies=false
#redirecting null problem.
redirect.url.security.mode=mysite.com
journal.template.velocity.restricted.variables=
admin.email.from.name=Market.Travel Team
admin.email.from.address=admin#mysite.com
# Added because of the Error - No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
hibernate.current_session_context_class=thread
session.enable.url.with.session.id=false
and my portal-developer.properties
theme.css.fast.load=false
theme.images.fast.load=false
javascript.fast.load=true
javascript.log.enabled=true
layout.template.cache.enabled=false
browser.launcher.url=
combo.check.timestamp=true
freemarker.engine.cache.storage=soft:1
freemarker.engine.modification.check.interval=0
openoffice.cache.enabled=false
velocity.engine.resource.manager.cache.enabled=false
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true
Addition: When I tried editing the css files I can see the changes fast. Just one reload the the changes appear. I think it is just in my velocity template that take some time or there's something wrong.
Liferay version: Liferay Portal Community Edition 6.0.6 CE
Thank You!
There is really no need to define your own portal-developer.properties. By adding -Dexternal-properties=portal-developer.properties to your JAVA_OPTS in tomcat/bin/setenv.(sh|bat) Liferay will use it's default developer settings, which are almost identical to what you have provided. However, I do not believe this is contributes to (or could resolve) your problem. More details here.
The developer properties do allow you to make live changes to the templates provided you are changing the right file. Due to the default context.xml Liferay provides to the deployed webapps, the webapps are copied/cached in tomcat/temp/{id}-webapp-name. This means if you change the template in webapp/mytheme then it may take tomcat a while to pick up on the change, if it notices the change at all (this will depend on the tomcat configuration). On the other hand, if you make a change in temp/1-mytheme it will show up immediately. Editing the files in the temp folder is probably not ideal, so...
How to fix this: (no specific order)
Prevent Tomcat from using the temp directory for your theme. Create a context.xml file for your theme.
<Context cachingAllowed="false"/>
This file should be placed in the META-INF folder of your
theme. If you are using the Liferay auto-deploy feature the
context.xml file may be clobbered, here, and here. If this
is the case you will need to find a work around that best suits your
needs, such as modifying the context.xml after the theme is deployed.
If you are using the Liferay Plugin-SDK the you can follow the fast plugin development guide for setting up your development environment.

Placeholder substitution in a Maven APT page

I am working on Maven site documentation for some related projects, and I want to create a hyperlink from one site's documentation to another sites documentation. The wrinkle is that the URL for the link target depends on a Maven property.
I tried this:
{{{http://example.com/site/project-${some-prop}/some.html}the documentation}}
but the ${some-prop} placeholder doesn't get replaced, and the APT processor then gets
confused by the first '}'. Escaping the { and } characters (e.g. $\{some-prop\} ) doesn't help, and the following doesn't work either:
{{http://example.com/site/project-${some-prop}/some.html}}
Is there some other way that I can accomplish this task? For example, is there a way to define a Doxia macro that could be used to substitute a URL that had the placeholder expanded?
Are you using version 2.0-beta-6 or later of the site plugin? Also, does your apt filename ends with a .vm extension (as described in the filtering section of Creating Content?

Resources