Configure richfaces resources plugin to generate custom javascript and css files in the one "FILE" (and not files)
anawak2002 Apr 5, 2012 5:30 AMHello,
i work with richfaces 4.2.
I have created a custom skin (ecss and js files) with maven-richfaces-resources-plugin.
But i have 2 questions:
1-the generated files are mapped in another files in staticResources folder(ex. file1.ecss --go to --> org.richfaces.staticResource/<version>/packed/<customskin>/cssfolder/file1.css
and file1.ecss ------> org.richfaces.staticResource/<version>/packed/<customskin>/cssfolder/file1.css)
Now, how can i configure the plugin to agragate all custom ecss files in the same file such as done in richfaces-component-ui.jar (ex. set every ecss files in org.richfaces.staticResource/<version>/packed/<customskin>/packed/custompacked.css and set every custom javascript in org.richfaces.staticResource/<version>/packed/packed/custompacked.js)
2- the custompacked.js can be load automatically in the target xhtml page such as richfaces css packed files? how to do?
This is my pom.xml
<plugin> <groupId>org.richfaces.cdk</groupId> <artifactId>maven-richfaces-resources-plugin</artifactId> <version>4.2.0.Final</version> <configuration> <skins> <skin>macif</skin> </skins> <excludedFiles> <exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude> <exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude> </excludedFiles> <includedContentTypes> <include>application/javascript</include> <include>text/css</include> <include>image/.+</include> </includedContentTypes> <fileNameMappings> <!-- Les images macif --> <property> <name>^.+macif.+/([^/]+\.(png|gif|jpg))$</name> <value>fr.macif.images/$1</value> </property> <!-- Resources des composants richfaces --> <property> <name>^org\.richfaces\.ckeditor/([^/]+\.(png|gif|jpg))$</name> <value>org.richfaces.ckeditor.images/$1</value> </property> <property> <name>^org\.richfaces\.ckeditor/([^/]+\.css)$</name> <value>org.richfaces.ckeditor.css/$1</value> </property> <property> <name>^org\.richfaces\.ckeditor/([^/]+\.(js))$</name> <value>org.richfaces.ckeditor.js/$1</value> </property> <property> <name>^org\.richfaces/([^/]+\.(png|gif|jpg))$</name> <value>org.richfaces.images/$1</value> </property> <property> <name>^org\.richfaces\.images/([^/]+\.(png|gif|jpg))$</name> <value>org.richfaces.images/$1</value> </property> <property> <name>^org\.richfaces/([^/]+\.css)$</name> <value>org.richfaces.css/$1</value> </property> <property> <name>^org\.richfaces/([^/]+\.js)$</name> <value>org.richfaces.js/$1</value> </property> </fileNameMappings> </configuration> <executions> <execution> <id>process-resources-Packed</id> <goals> <goal>process</goal> </goals> <configuration> <staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/staticResourceMapping/Packed.properties</staticResourceMappingFile> <resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/4.2.0.Final/Packed/</resourcesOutputDir> <staticResourcePrefix>org.richfaces.staticResource/4.2.0.Final/Packed/</staticResourcePrefix> <pack>true</pack> <compress> false </compress> </configuration> </execution> <execution> <id>process-resources-compressed</id> <goals> <goal>process</goal> </goals> <configuration> <staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/staticResourceMapping/Compressed.properties</staticResourceMappingFile> <resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/4.2.0.Final/Compressed/</resourcesOutputDir> <staticResourcePrefix>org.richfaces.staticResource/4.2.0.Final/Compressed/</staticResourcePrefix> <pack>false</pack> <compress>true</compress> </configuration> </execution> <execution> <id>process-resources-packed-compressed</id> <goals> <goal>process</goal> </goals> <configuration> <staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/staticResourceMapping/PackedCompressed.properties</staticResourceMappingFile> <resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/4.2.0.Final/PackedCompressed/</resourcesOutputDir> <staticResourcePrefix>org.richfaces.staticResource/4.2.0.Final/PackedCompressed/</staticResourcePrefix> <pack>true</pack> <compress> true </compress> </configuration> </execution> <execution> <id>process-resources-static</id> <goals> <goal>process</goal> </goals> <configuration> <staticResourceMappingFile>${project.build.outputDirectory}/META-INF/richfaces/staticResourceMapping/Static.properties</staticResourceMappingFile> <resourcesOutputDir>${project.build.outputDirectory}/META-INF/resources/org.richfaces.staticResource/4.2.0.Final/Static/</resourcesOutputDir> <staticResourcePrefix>org.richfaces.staticResource/4.2.0.Final/Static/</staticResourcePrefix> <pack>false</pack> <compress> false </compress> </configuration> </execution> </executions> </plugin>
Thank you