Convert to Maven Project produit un pom.xml en erreur
Bonjour,
J'ai installé le plugin Android for Maven Eclipse "m2e-android" et j'ai tenté plusieurs fois de convertir un projet Android (Mon projet fonctionne sans le convertir) déjà existant sans succès.
Pour ce faire, je clique droit sur le projet dans la fenêtre "package explorer" d'eclipse puis je sélectionne "convert to Maven Project".
Un fichier pom.xml est alors créé mais ce dernier est directement en erreur alors que l'on pourrait s'attendre que, suite à la conversion, il n'y ait pas d'erreur. Et je ne comprends donc pas d'où ce problème peut provenir surtout que sur internet, je ne trouve aucun signalement de cette erreur.
Donc voici les différents fichiers de mon projet :
main.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/Table"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0,1,2,3,4"
xmlns:android="http://schemas.android.com/apk/res/android">
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/ButtonRed" android:text="@string/ButtonRed" />
<Button android:id="@+id/ButtonGreen" android:text="@string/ButtonGreen" />
<Button android:id="@+id/ButtonBlue" android:text="@string/ButtonBlue" />
<Button android:id="@+id/ButtonBlack" android:text="@string/ButtonBlack" />
<Button android:id="@+id/ButtonWhite" android:text="@string/ButtonWhite" />
</TableRow>
</TableLayout> |
strings.xml
Code:
1 2 3 4 5 6 7 8 9
| <?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HelloFlashlight</string>
<string id="ButtonRed" name="ButtonRed">Red</string>
<string id="ButtonBlue" name="ButtonBlue">Blue</string>
<string id="ButtonGreen" name="ButtonGreen">Green</string>
<string id="ButtongBlack" name="ButtonBlack">Black</string>
<string id="ButtonWhite" name="ButtonWhite">White</string>
</resources> |
HelloFlashlight.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| package com.simpligility.android.helloflashlight;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
/**
* HelloFlashlight is a sample application for the usage of the Maven Android Plugin.
* The code is trivial and not the focus of this example and therefore not really documented.
*
* @author Manfred Moser <manfred@simpligility.com>
*/
public class HelloFlashlight extends Activity {
TableLayout table;
Button redButton;
Button greenButton;
Button blueButton;
Button blackButton;
Button whiteButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// get all the view components
table = (TableLayout) findViewById(R.id.Table);
redButton = (Button) findViewById(R.id.ButtonRed);
greenButton = (Button) findViewById(R.id.ButtonGreen);
blueButton = (Button) findViewById(R.id.ButtonBlue);
blackButton = (Button) findViewById(R.id.ButtonBlack);
whiteButton = (Button) findViewById(R.id.ButtonWhite);
// default the full screen to white
table.setBackgroundColor(Color.WHITE);
// hook up all the buttons with a table color change on click listener
redButton.setOnClickListener(OnClickChangeColor(Color.RED));
greenButton.setOnClickListener(OnClickChangeColor(Color.GREEN));
blueButton.setOnClickListener(OnClickChangeColor(Color.BLUE));
blackButton.setOnClickListener(OnClickChangeColor(Color.BLACK));
whiteButton.setOnClickListener(OnClickChangeColor(Color.WHITE));
}
/**
* An OnClickListener that changes the color of the table.
* @param color
* @return
*/
View.OnClickListener OnClickChangeColor(final int color)
{
return new View.OnClickListener() {
public void onClick(View view) {
table.setBackgroundColor(color);
}
};
}
} |
AndroidManifest.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.simpligility.android.helloflashlight"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloFlashlight"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest> |
pom.xml (généré par "convert to Maven Project") :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.simpligility.android</groupId>
<artifactId>helloflashlight</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>
<name>HelloFlashlight</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<!-- platform as api level (api level 16 = platform 4.1)-->
<platform>16</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
</project> |
et voici le texte de l'erreur que j'obtient dans eclipse à la ligne 35 <plugin> :
Code:
1 2 3 4 5 6 7 8 9 10
| Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:proguard (execution:
default-proguard, phase: process-classes)
- Plugin execution not covered by lifecycle configuration:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources
(execution: default-generate-sources, phase: generate-sources)
- Plugin execution not covered by lifecycle configuration:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:consume-aar (execution:
default-consume-aar, phase: compile) |
Si quelqu'un veut bien m'apporter son aide, je vous en remercie !