Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356311

Summary: [mojo] org.codehaus.mojo.jspc:jspc-maven-plugin support
Product: z_Archived Reporter: gdt <greg.d.thomas>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample Eclipse project
none
Improved solution to the problem none

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/