Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356311 - [mojo] org.codehaus.mojo.jspc:jspc-maven-plugin support
Summary: [mojo] org.codehaus.mojo.jspc:jspc-maven-plugin support
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-31 08:14 EDT by gdt CLA
Modified: 2021-04-19 13:27 EDT (History)
1 user (show)

See Also:


Attachments
Sample Eclipse project (3.71 KB, application/unknown)
2011-08-31 08:14 EDT, gdt CLA
no flags Details
Improved solution to the problem (3.61 KB, application/zip)
2011-09-21 09:32 EDT, gdt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description gdt CLA 2011-08-31 08:14:17 EDT
Created attachment 202506 [details]
Sample Eclipse project

We're using the jspc-maven-plugin plugin to pre-compile our JSP files before bundling these up in to a WAR file. By default, M2E gives the error "M2E plugin execution not covered", and as per the instructions at http://wiki.eclipse.org/M2E_plugin_execution_not_covered I'm documenting my findings here.

Because the jsp compilation is not required for WTP to work within Eclipse, simply disabling the plugin is sufficient for everything to work nicely; 

    <pluginManagement>
    	<!--  Disable the jspc plugin when running in Eclipse -->
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo.jspc</groupId>
                                    <artifactId>jspc-maven-plugin</artifactId>
                                    <versionRange>[1.0.0,)</versionRange>
                                    <goals>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore/>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

I've also attached a trivial project that demonstrates this behaviour - with the above configuration jspc-maven-plugin is ignored when running in Eclipse, but is correctly used to pre-compile the JSP files when the project is packaged using Maven.
Comment 1 gdt CLA 2011-09-21 09:32:10 EDT
Created attachment 203762 [details]
Improved solution to the problem

I've attached what I think is a better solution to the problem; 

The attached ZIP file has two profiles; one is activated outside of m2e, and pre-compiles the JSP pages and use the modified web.xml file in the WAR file. 
by having two profiles

The other is activated when running with m2e; it has no settings, so uses the default of no-precompiled JSP pages and the original web.xml file.

This works well; when running in Eclipse, the source JSP files are used, and when packaged, the pre-compiled ones are used.
Comment 2 Igor Fedorenko CLA 2013-09-29 09:45:17 EDT
closing old/stale bugreports
Comment 3 Denis Roy CLA 2021-04-19 13:27:13 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/