0

This is the build-section of my pom.xml. I have only one pom.xml for the whole project.

<build>
    <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>build-helper-maven-plugin</artifactId>
                                    <versionRange>[1.1,)</versionRange>
                                    <goals>
                                        <goal>add-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/projects</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
                <dependencies>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.5</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/jar-dep.xml</descriptor>
                        <descriptor>src/main/assembly/src-zip.xml</descriptor>
                        <descriptor>src/main/assembly/bin-zip.xml</descriptor>
                    </descriptors>
                    <archive>
                        <manifest>
                            <mainClass>myProject.Main</mainClass>
                        </manifest>
                    </archive>
                    <appendAssemblyId>true</appendAssemblyId>
                    <archiverConfig>
                        <compress>true</compress>
                    </archiverConfig>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

If I remove the -tags, it comiles just fine, but eclipse complains as follows: Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.1:add-source (execution: add-source, phase: generate-sources)

If I leave the tags, eclipse shows no errors in the pom.xml, but the additional sources are not compiled and not added to the jar-files. What is wrong?

Funkwecker
  • 766
  • 13
  • 22
  • 2
    you are configuring the plugin within the `pluginManagement` section, which will be ignored if the plugin is not used then into the `build/plugins` section. Check http://stackoverflow.com/questions/10483180/maven-what-is-pluginmanagement – A_Di-Matteo Apr 29 '16 at 08:38
  • 1
    ^^^^ yep, that's the answer. You should either move that into the `` section or keep it as-is but declare it inside `` (without the version). – Tunaki Apr 29 '16 at 08:40
  • Well, that works! Thank you very much! – Funkwecker Apr 29 '16 at 08:56
  • 1
    @Julian You should have on the top of your question a button that says "This question is a duplicate" or something. If you click it, it will close this as a duplicate of the linked one. This will help future visitors to be directed to the answer :). Thanks. – Tunaki Apr 29 '16 at 10:39

0 Answers0