Brijesh619 commented on code in PR #721:
URL: https://github.com/apache/atlas/pull/721#discussion_r3933492284
##########
webapp/pom.xml:
##########
@@ -683,6 +683,84 @@
</tasks>
</configuration>
</execution>
+ <execution>
+ <id>fix-enunciate-csp-assets</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <skip>${skipEnunciate}</skip>
+ <tasks>
+ <!-- Copy CSS -->
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/css">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/css" />
+ </copy>
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/apidocs/css">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/css" />
+ </copy>
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/apidocs/ui/css">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/css" />
+ </copy>
+
+ <!-- Copy JS (Note: jQuery 1.12.2 is pinned
for compatibility with Bootstrap 3.4.1 in static Enunciate REST API
documentation) -->
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/js">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/js" />
+ </copy>
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/apidocs/js">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/js" />
+ </copy>
+ <copy failonerror="true"
todir="${project.build.directory}/api/v2/apidocs/ui/js">
+ <fileset
dir="${project.basedir}/src/main/enunciate-assets/js" />
+ </copy>
+
+ <!-- Replace URLs -->
+ <replace
dir="${project.build.directory}/api/v2" includes="**/*.html"
token="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
value="css/bootstrap.min.css" />
+ <replace
dir="${project.build.directory}/api/v2" includes="**/*.html"
token="https://code.jquery.com/jquery-1.12.2.min.js"
value="js/jquery-1.12.2.min.js" />
+ <replace
dir="${project.build.directory}/api/v2" includes="**/*.html"
token="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
value="js/bootstrap.min.js" />
+ <replace
dir="${project.build.directory}/api/v2" includes="**/*.html"
token="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"
value="js/run_prettify.js" />
+ <replace
dir="${project.build.directory}/api/v2" includes="**/*.js"
token="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/"
value="" />
+
+ <!-- Verify no CDN URLs remain -->
+ <fail message="Build failure: CDN references
to bootstrapcdn.com found in generated API docs!">
Review Comment:
I have added a positive check in webapp/pom.xml after the replacement tasks.
The build will now explicitly <fail> if any of the bundled assets
(bootstrap.min.css, jquery-1.12.2.min.js, bootstrap.min.js, or run_prettify.js)
are missing from the generated API docs directory, ensuring they were copied
correctly instead of just checking that the CDN strings are absent.
Let me know if there's anything else you'd like to adjust!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]