Bonjour à toutes et à tous,
J'aimerai pouvoir inclure Maven à mon projet.
Pour cela, j'ai :
- Installé maven,
- Créé un projet Android basic en version:
- Ajouté un pom.xml:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="16" />
- exécuté la commande mvn clean install, et j'ai l'erreur suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?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.example</groupId> <artifactId>testmavenactiveandroid</artifactId> <version>0.1</version> <packaging>apk</packaging> <name>Maven Example</name> <dependencies> <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <version>4.1.2</version> <scope>provided</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <version>3.5.0</version> <configuration> <sdk> <platform>16</platform> </sdk> <undeployBeforeDeploy>true</undeployBeforeDeploy> </configuration> <extensions>true</extensions> </plugin> </plugins> </build> </project>
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.google.android:android:jar:4.1.2
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.android -DartifactId=android -Dversion=4.1.2 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.android -DartifactId=android -Dversion=4.1.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[u
rl] -DrepositoryId=[id]
Path to dependency:
1) com.example:testmavenactiveandroid:apk:0.1
2) com.google.android:android:jar:4.1.2
----------
1 required artifact is missing.
for artifact:
com.example:testmavenactiveandroid:apk:0.1
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Quelqu'un serait résoudre ce problème?
Merci d'avance
Partager