https://bz.apache.org/bugzilla/show_bug.cgi?id=66191

            Bug ID: 66191
           Summary: compile taglibs that are not (yet) included in jsp
                    file
           Product: Tomcat 10
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: andreas.sta...@rmcon-int.de
  Target Milestone: ------

## Issue Description
We are using jetty-jspc-maven-plugin (which uses Jasper JspC) to compile jsp
and tag files in our build.
We have some Maven projects that contain only taglibs (tld files) but no jsp
files.

Sadly, these taglibs are not compiled when the project is compiled.

It seems the jsp compiler does a top to bottom approach, starting with jsp
files and including everything in the compilation that is reachable from these.
Because our taglib project does not contain a jsp file, nothing is compiled.

When including tag files explicitly ( <includes>**/*.tag, **/*.jsp,
**/*.jspx</includes> ) then these are still considered as jsp files and it
results in an error: [&lt;%@ tag] directive can only be used in a tag file

## Desired Solution
Include an option compileUnusedTaglibs (name is only a suggestion).
It should search for tld files and compile everything that is reachable from
these.

## Motivation
At the moment, our taglib is only compiled as part of a later project.
Sadly, project dependencies are not enforced because of this.

Example:
- TaglibProject is Referenced by WebAppProject.
- TaglibProject uses Java classes from WebAppProject prematurely in tag files
- TaglibProject tag files are not compiled yet. Thus no error.
- WebAppProject is compiled. The prematurely used Java files are not present.
Thus no error.

It works. But it would be better for our project structure, if it would not be
possible to use classes from later projects prematurely in tag files or earlier
projects. taglib compilation would enforce this.

You can find here a small example project to reproduce the issue:
https://github.com/achimmihca/multi.module.webapp.demo

## Additional Notes
I was redirected here from the jetty-jspc-maven-plugin team:
https://github.com/eclipse/jetty.project/issues/8316

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to