This file provides instructions for AI coding agents (GitHub Copilot, Cursor, Cline, etc.) to effectively work with the Sentry Maven Skin project.
Caution
Keep documentation in sync with code changes!
- When behavior of the skin changes, review and update the documentation site (
src/site/markdown/*.md) - When project structure or build process changes, update
AGENTS.mdandREADME.md - Always verify documentation renders correctly after skin changes:
mvn clean install site
The Sentry Maven Skin is an Apache Maven site skin that transforms Markdown files into a modern HTML5/Bootstrap documentation website with search, syntax highlighting, and responsive design.
| Technology | Purpose | Location |
|---|---|---|
| Velocity | HTML templating | src/main/webapp/*.vm |
| JavaScript | Frontend logic (AngularJS) | src/main/webapp/js/*.js |
| CSS/SCSS | Styling | src/main/webapp/css/ |
| HTML | Angular templates | src/main/webapp/*.html |
| Gulp.js | Build system for frontend | gulpfile.js |
| Maven | Build orchestration | pom.xml |
| Groovy | Integration test verification | src/it/*/verify.groovy |
The skin requires maven-skin-tools (org.sentrysoftware.maven:maven-skin-tools) which provides custom Velocity tools for HTML processing, search indexing, image optimization, and more. Refer to the maven-skin-tools documentation when working on Velocity templates.
sentry-maven-skin/
├── src/
│ ├── main/webapp/ # Frontend source code
│ │ ├── site.vm # Main Velocity template entry point
│ │ ├── init.vm # Initialization and variable setup
│ │ ├── macros.vm # Reusable Velocity macros
│ │ ├── head.vm # HTML <head> section
│ │ ├── metadata.vm # Meta tags and JSON-LD
│ │ ├── banner.vm # Header banner and navigation
│ │ ├── left-menu.vm # Left sidebar menu
│ │ ├── main.vm # Main content area
│ │ ├── content.vm # Body content processing
│ │ ├── blockquotes.vm # UI components (tabs, accordions, etc.)
│ │ ├── footer.vm # Page footer
│ │ ├── js.vm # JavaScript includes
│ │ ├── css/ # Compiled stylesheet outputs (sentry.css, prism-theme.css, copy-to-clipboard.css, print.css)
│ │ ├── js/ # JavaScript files (site.js, site-index.js)
│ │ └── fonts/ # Custom fonts
│ ├── it/ # Integration tests
│ │ ├── settings.xml # Maven settings for IT
│ │ ├── studio-km/ # Main test project (Maven Site Plugin 3.x)
│ │ └── site4/ # Test project for Maven Site Plugin 4.x
│ └── site/ # Project's own documentation (dogfooding)
├── gulpfile.js # Gulp build tasks for frontend
├── package.json # Node.js dependencies
├── pom.xml # Maven build configuration
└── target/ # Build output (gitignored)
Note
src/main/webapp/css/scss/ contains the modular SCSS sources. Gulp compiles scss/sentry.scss, scss/prism-theme.scss, scss/copy-to-clipboard.scss, and scss/print.scss into target/tmp/webapp/css/ before useref.
mvn clean install siteThis command:
- Cleans previous build artifacts
- Installs Node.js locally and runs
npm ci - Runs Gulp to build, lint, and minify frontend assets (including SCSS compilation of
css/scss/*.scssentrypoints into temp CSS before useref, and conversion of UTF-8resources*.propertiesfiles into Java 8-safe\uXXXXescaped bundles inMETA-INF/maven) - Packages the Maven skin JAR
- Runs integration tests (
studio-kmandsite4) - Generates this project's own documentation site
Important
Always use mvn clean install site for a full rebuild. The clean phase is needed because Maven's incremental build doesn't always detect changes in Velocity templates or frontend assets. The install phase must run before site because this project uses itself as its own skin (dogfooding).
| Output | Description |
|---|---|
target/sentry-maven-skin-*.jar |
The skin artifact |
target/it/studio-km/target/site/ |
Integration test output (3.x) |
target/it/site4/target/site/ |
Integration test output (4.x) |
target/site/ |
This project's documentation |
target/it/*/build.log |
Build logs (check on failure) |
# Install http-server globally (once)
npm install --global http-server
# Serve any generated site
http-server target/it/studio-km/target/site # Integration test (3.x)
http-server target/it/site4/target/site # Integration test (4.x)
http-server target/site # Project documentation- Edit files in
src/main/webapp/(frontend) orsrc/site/(documentation) - Run
mvn clean install site - Preview results in
target/it/studio-km/target/site/ortarget/site/
Tip
When changing skin behavior, always run mvn clean install site and check both integration tests (studio-km for Maven Site Plugin 3.x, site4 for 4.x) and the project's own documentation site.
When the behavior of the skin is not changed (for example when you're updating the documentation or the integration tests), you must not run a full build cycle:
- For documentation only changes, simply run
mvn site. - For tests changes, run
mvn verify.
When debugging integration tests, you can iterate faster:
- Edit files in
src/it/studio-km/orsrc/it/site4/ - Run
mvn verify(faster than fullinstall site) - Check
target/it/*/build.logfor output
Debugging Velocity templates: Use $log.debug(...) in .vm files to output debug information to build.log:
#call($log.debug("Variable value: $myVariable"))
#call($log.debug($bodyContent))npm run format # Auto-fix formatting (Prettier)
npm run format:check # Check only (CI mode)
npm run lint # Check for linting issues (ESLint)
npm run lint:fix # Auto-fix linting issuesFormatting policy:
- Text files must be UTF-8 without BOM and use CRLF line endings.
.editorconfig,.gitattributes, and Prettier (endOfLine: "crlf") are the primary enforcement mechanisms.
No automated formatting. Follow these conventions:
- Indentation: Use tabs
- Comments:
#* ... *#for multi-line,## ...for single-line - Whitespace control: Use
#*...*#to suppress unwanted EOLs
#**
* Macro documentation
**
*##macro(myMacro $param)#*
*##if ($param)#*
*#<div>$param</div>#*
*##end#*
*##endIntegration tests run automatically during mvn install. Each test:
- Builds a documentation site using the skin
- Verifies output with
verify.groovyusing JSoup for HTML parsing
The tests use JSoup CSS selectors to verify HTML structure, making assertions more readable and robust:
// Example: Check meta tag content
assert doc.select('meta[name=description]').attr('content').startsWith('Expected...') : "Description must be set"
// Example: Verify element structure
assert doc.select('main.main-content .search-results').size() > 0 : "Search results must be inside main"| Test Project | Maven Site Plugin | Source Location |
|---|---|---|
studio-km |
3.x | src/it/studio-km/ |
site4 |
4.x | src/it/site4/ |
| Problem | Solution |
|---|---|
| Changes not reflected | Run mvn clean install site (not just mvn site) |
NoSuchFileException: target/classes |
Run install before site (dogfooding requirement) |
| NPM errors | Delete node/, node_modules/, package-lock.json, rebuild |
| Velocity syntax errors | Check target/it/*/build.log for details |
- JavaScript: Double quotes, AngularJS 1.x patterns
- CSS: Bootstrap conventions, CSS variables for theming
- Velocity: Use
$!variablefor potentially null values,#call()to ignore return values
| File | Purpose |
|---|---|
src/main/webapp/site.vm |
Main template entry point |
src/main/webapp/init.vm |
Variable initialization and setup |
src/main/webapp/macros.vm |
Reusable Velocity macros |
src/main/webapp/head.vm |
HTML head section (CSS, meta tags) |
src/main/webapp/metadata.vm |
Meta tags and schema.org JSON-LD |
src/main/webapp/banner.vm |
Header banner and top navigation |
src/main/webapp/left-menu.vm |
Left sidebar navigation menu |
src/main/webapp/main.vm |
Main content wrapper and search results |
src/main/webapp/content.vm |
Body content processing (TOC, images, etc.) |
src/main/webapp/blockquotes.vm |
UI components (tabs, accordions, collapsibles) |
src/main/webapp/footer.vm |
Page footer with copyright and links |
src/main/webapp/js.vm |
JavaScript includes |
src/main/webapp/js/site.js |
Main AngularJS application |
src/main/webapp/css/scss/sentry.scss |
Main SCSS entrypoint |
src/main/webapp/css/scss/prism-theme.scss |
Prism theme SCSS source |
src/main/webapp/css/scss/copy-to-clipboard.scss |
Copy-to-clipboard SCSS source |
src/main/webapp/css/scss/print.scss |
Print stylesheet SCSS source |
src/site/markdown/*.md |
Project documentation (dogfooding) |