|
114 | 114 | <phase>generate-sources</phase>
|
115 | 115 | <configuration>
|
116 | 116 | <generateJavaClasses>true</generateJavaClasses>
|
| 117 | +#if ( $precompiledScripts == "n") |
117 | 118 | <generatedJavaClassesPrefix>org.apache.sling.scripting.sightly</generatedJavaClassesPrefix>
|
| 119 | +#end |
118 | 120 | <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
|
119 | 121 | <allowedExpressionOptions>
|
120 | 122 | <allowedExpressionOption>cssClassName</allowedExpressionOption>
|
|
129 | 131 | </plugins>
|
130 | 132 | </build>
|
131 | 133 |
|
| 134 | +#if ( $precompiledScripts == "y" and $aemVersion == "cloud" ) |
| 135 | + <profiles> |
| 136 | + <profile> |
| 137 | + <id>precompiledScripts</id> |
| 138 | + <activation> |
| 139 | + <property> |
| 140 | + <name>skipScriptPrecompilation</name> |
| 141 | + <value>!true</value> |
| 142 | + </property> |
| 143 | + </activation> |
| 144 | + <build> |
| 145 | + <plugins> |
| 146 | + <plugin> |
| 147 | + <groupId>biz.aQute.bnd</groupId> |
| 148 | + <artifactId>bnd-maven-plugin</artifactId> |
| 149 | + <executions> |
| 150 | + <execution> |
| 151 | + <id>bnd-process</id> |
| 152 | + <goals> |
| 153 | + <goal>bnd-process</goal> |
| 154 | + </goals> |
| 155 | + <configuration> |
| 156 | + <packagingTypes>content-package</packagingTypes> |
| 157 | + <bnd><![CDATA[ |
| 158 | +Bundle-Name: ${project.name} - precompiled scripts |
| 159 | +Bundle-SymbolicName: ${project.groupId}.${project.artifactId}.precompiled-scripts |
| 160 | +-plugin: org.apache.sling.scriptingbundle.plugin.bnd.BundledScriptsScannerPlugin; \ |
| 161 | + sourceDirectories="src/main/content/jcr_root"; \ |
| 162 | + includes="**/.content.xml,**/*.html" |
| 163 | +Require-Capability: osgi.extender;filter:="(&(osgi.extender=sling.scripting)(version>=1.0.0)(!(version>=2.0.0)))" |
| 164 | + ]]> |
| 165 | + </bnd> |
| 166 | + </configuration> |
| 167 | + </execution> |
| 168 | + </executions> |
| 169 | + </plugin> |
| 170 | + <plugin> |
| 171 | + <groupId>org.apache.maven.plugins</groupId> |
| 172 | + <artifactId>maven-jar-plugin</artifactId> |
| 173 | + <executions> |
| 174 | + <execution> |
| 175 | + <phase>package</phase> |
| 176 | + <goals> |
| 177 | + <goal>jar</goal> |
| 178 | + </goals> |
| 179 | + <configuration> |
| 180 | + <classifier>precompiled-scripts</classifier> |
| 181 | + <archive> |
| 182 | + <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> |
| 183 | + </archive> |
| 184 | + </configuration> |
| 185 | + </execution> |
| 186 | + </executions> |
| 187 | + </plugin> |
| 188 | + <plugin> |
| 189 | + <groupId>org.apache.sling</groupId> |
| 190 | + <artifactId>sling-maven-plugin</artifactId> |
| 191 | + <configuration> |
| 192 | + <bundleFileName>${project.build.directory}/${project.build.finalName}-precompiled-scripts.jar</bundleFileName> |
| 193 | + </configuration> |
| 194 | + </plugin> |
| 195 | + </plugins> |
| 196 | + </build> |
| 197 | + </profile> |
| 198 | + </profiles> |
| 199 | +#end |
| 200 | + |
132 | 201 | <!-- ====================================================================== -->
|
133 | 202 | <!-- D E P E N D E N C I E S -->
|
134 | 203 | <!-- ====================================================================== -->
|
|
0 commit comments