Carsten Ziegeler wrote:
Leszek Gawron wrote
As long as it is configured automatically so the only thing that user
does is:
mvn clean compile cocoon:deploy jetty:run
I'm not that familiar with all aspects of the cocoon:deploy plugin, but
I thought that this one is deploying all files into the necessary locations?
Not exactly. This is only one mode of operation when you work on
cocoon-webapp archetype.
If you invoke it for any project that is not war packaged then it is
assumed you are locally developing your cocoon block. Your main
sitemap.xmap, cocoon.xconf, web.xml and bunch of other core files get
generated:
--- sitemap.xmap ---
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:classloader factory-role="org.apache.cocoon.classloader.ClassLoaderFactory/reloading">
<class-dir
src="file:/c:/dev/projects/donnelley/donnelley-admin/target/classes/"/>
</map:classloader>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="blocks/donnelley-admin/"/>
</map:match>
<!-- resources of block jars -->
<map:match pattern="_cocoon/resources/*/**">
<map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
</map:match>
<!-- mount all development blocks -->
<map:match pattern="blocks/donnelley-block-common/**">
<map:mount uri-prefix="blocks/donnelley-block-common"
src="file:/c:/dev/projects/donnelley/donnelley-admin/../donnelley-block-common/src/main/resources/COB-INF/"/>
</map:match>
<map:match pattern="blocks/donnelley-admin/**">
<map:mount uri-prefix="blocks/donnelley-admin"
src="file:/c:/dev/projects/donnelley/donnelley-admin/src/main/resources/COB-INF/"/>
</map:match>
<!-- mount all deployed blocks -->
<map:match pattern="*/**">
<map:mount src="{1}/" uri-prefix="{1}"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
features: - local classes loaded via reloading classloader
- COB-INF sources mounted directly from src/ directory
- COB-INF from other modules (if specified) also mounted from
source
--- web.xml ---
generated from scratch, all cocoon blocks contribute patches from
META-INF/xpatch/*.xweb
cocoon.xconf:
<cocoon version="2.2">
<!--+
| Include the core roles definitions. This is for the sake of clarity,
| as they are implicitely loaded at startup, but we may want to remove
| this implicit behaviour in the future now that we have the include
| mechanism.
+-->
<include src="resource://org/apache/cocoon/cocoon.roles"/>
<!--+
| Include all configuration files ending with ".xconf"
| from the xconf directory.
+-->
<include dir="context://WEB-INF/cocoon/xconf" pattern="*.xconf"/>
<!--+
| Include all configuration files ending with ".xmap"
| from the sitemap-additions directory.
+-->
<include dir="context://WEB-INF/cocoon/sitemap-additions" pattern="*.xmap"/>
<!--+
| Include Spring beans definition files ending with ".xml" from
| the spring directory.
+-->
<include-beans dir="context://WEB-INF/cocoon/spring" pattern="*.xml"/>
<include-beans
dir="file:/c:/dev/projects/donnelley/donnelley-admin/src/main/resources/META-INF/spring/"
pattern="*.xml"/>
<include dir="file:/c:/dev/projects/donnelley/donnelley-admin/src/main/resources/META-INF/legacy/xconf/" pattern="*.xconf"/>
<include dir="file:/c:/dev/projects/donnelley/donnelley-admin/src/main/resources/META-INF/legacy/sitemap-additions/" pattern="*.xmap"/>
</cocoon>
features:
- local spring contexts, avalon context and sitemap additions mounted
directly from source directory
The main goal is to provide everything from source folder.
The blocks consists of:
- COB-INF resources (covered with mount in sitemap)
- java classes (loaded on sitemap level with reloading classloader, now
gets me thinking it will break if block supplies some core spring beans)
- avalon contexts (covered by include in cocoon.xconf)
- spring contexts (covered by include in cocoon.xconf)
- sitemap additions (covered by include in cocoon.xconf)
- properties
- those in src/main/resources/COB-INF/config/properties/ covered by
automatic loading in block sitemap
- those in src/main/resources/META-INF/properties are NOT COVERED
--
Leszek Gawron, IT Manager MobileBox sp. z o.o.
+48 (61) 855 06 67 http://www.mobilebox.pl
mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65