filipp.kowalski
filipp.kowalski

Reputation: 5605

Maven plugin error in Eclipse

I am writing POM.xml file for Android app and I constantly get an error. It appears after I use Maven plugin in Eclipse (Project->properties->Configure->Convert to Maven). I put an error below the code.

<build>
    <finalName>${project.artifactId}</finalName>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
                <execution>
                    <!-- use the copy resources instead of resources, which adds it to 
                        the eclipse buildpath -->
                    <phase>initialize</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.basedir}/res</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${project.basedir}/src/templates/res</directory>
                                <targetPath>${project.basedir}/res</targetPath>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin> <!----- Error here ---------->
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <manifest>
                    <debuggable>true</debuggable>
                </manifest>
            </configuration>
            <executions>
                <execution>
                    <id>manifestUpdate</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>manifest-update</goal>
                    </goals>
                </execution>
                <execution>
                    <id>alignApk</id>
                    <phase>package</phase>
                    <goals>
                        <goal>zipalign</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Error :

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.1:proguard (execution: default-proguard, phase: process-classes)
- Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.1:generate-sources (execution: default-generate-sources, phase: generate-
 sources)

Upvotes: 1

Views: 1734

Answers (2)

Ricardo Gladwell
Ricardo Gladwell

Reputation: 3785

Installing the Android Connector for Maven Eclipse should resolve this issue.

Upvotes: 1

sschrass
sschrass

Reputation: 7166

wrap your <plugins> with <pluginManagement> like so:

<pluginManagement>
    <plugins>
       <plugin>
           ...
       </plugin>
       <plugin>
           ...
       </plugin>
    </plugins>
</pluginManagement>

for further reading: How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

Upvotes: 3

Related Questions