How do you get output from a maven plugin in Eclipse when using the m2e lifecycle-mapping?

Viewed 159

I'm unable to get any output from the custom java class (SchemaGenerator) to output in the Eclipse Maven console. Is there a way to do this? The class currently uses sys out and sys err, which appears in the output when using mvn from command line.

<build>

    <!-- allow m2e to trigger the exec-maven-plugin -->
    <pluginManagement>
        <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</groupId>
                                    <artifactId>exec-maven-plugin</artifactId>
                                    <versionRange>[1,)</versionRange>
                                    <goals>
                                        <goal>java</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute>
                                        <runOnConfiguration>true</runOnConfiguration>
                                        <runOnIncremental>true</runOnIncremental>
                                    </execute>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

    <plugins>
        <!-- custom build step -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
                <execution>
                    <id>SchemaGenerator</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>java</goal>
                    </goals>
                    <configuration>
                        <includePluginDependencies>true</includePluginDependencies>
                        <includeProjectDependencies>false</includeProjectDependencies>
                        <mainClass>jit.SchemaGenerator</mainClass>
                        <arguments>
                            <argument>${project.build.outputDirectory}</argument>
                            <argument>schema.xml</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>jit</groupId>
                    <artifactId>schema-generator</artifactId>
                    <version>0.0.1</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>

</build>
0 Answers
Related