Trouble with the Ultimate Maven POM,solutions here - Android2eeAndroid2ee formation expert android
× Graphical User Interface

Trouble with the Ultimate Maven POM,solutions here

Plus d'informations
il y a 12 ans 5 mois - il y a 12 ans 5 mois #23 par mseguy
COM_KUNENA_MESSAGE_CREATED_NEW
:blush:
Chapter 15.2.1.1: Do it using the downlaoadable generic Android project.
p245-246
About the Ultimate Android POM, I use the jar yesterday and suprise, it doesn't work... arg what a f...k !
So i look at it, and, nop, the pom is correct, there is just few stuff to look further and to explain much more :

/!\ Warning/!\
When importing the project within Eclipse, the project's classpath is changed by eclipse, you have to set it back to this classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>



Furthermore, during this bug hunt, i also notice that some lines in the how to section has to be added (in bold what is missing):
  • -Import then project into Eclipse (the parent project) by using « import an existing maven project ».


  • -Perform a « search and replace » of :


  • o « com.android2ee.android.tuto.maven » swap it for the GroupId of your project


  • o « AndroidGenericProject » swap it for the ArtifactId of your project


  • -Rename the packages' name accordingly in the project **-ap et **-it (that still looks like com.android2ee.android.tuto.maven)


  • -Delete then re-import the project into the Eclipse workspace (the parent project) using « import an existing maven project ».


  • -Do a right clic on the project **-ap and in the menu choose Maven->UpdateProjectConfiguration


  • -Do a right clic on the project **-it and in the menu choose Maven->UpdateProjectConfiguration


  • -Copy the contents of the setting.xml file found at the root of the parent project within your own setting.xml file (the one of your workstation, the one used by Maven when building your project). In the file setting.xml, you have to add the AVD that you curently use. To do that, in the following piece of code:

    <profile>
    			<id>AVD-Google3</id>
    			<properties>
    				<!--The path to the Android SDK-->
    				<avd-name>Google3</avd-name>
    			</properties>
    		</profile>
    You have to change the id by the id of your own AVD and the avd-name by the real name of your AVD (the one displayed in the AVD manager of Eclipse).
    Then you have to define which AVD is your default AVD, this definition is done at the top of the setting file. To do that, change the following block:
    <activeProfiles>
    		<activeProfile>android-project</activeProfile>
    		<activeProfile>[i]AVD-Google10[/i]</activeProfile>
    	</activeProfiles>
    And instead of AVD-Google10 you have to set the id of your own default AVD.


  • -If needed, change the version numbers in the Pom file of the parent project and update the path values in the setting.xml file.


  • -In the manifest, change the minimum SDK version that you wish to use : : <uses-sdk android:minSdkVersion="3" />


  • -Change in the both files default.properties the version of the target project. You have to put the value of your minSdkVersion (above modified)

    # Project target.

    target=android-7

    And set the same level number intead of the seven.


  • -Check your projects' classpath have not change (the above warning)


  • -Perform a cleaning operation (RunAs->maven Clean)


  • -Your project is now operational and ready for continuous integration.



  • Mathias Séguy
    Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser.
    Auteur Android2ee.com
    Docteur en Mathématiques Fondamentales
    Directeur Technique & Avant-vente
    Expert Technique de l'Agence Nationale de la Recherche
    Rédacteur sur Developpez.com
    Last edit: il y a 12 ans 5 mois by mseguy.

    S'il vous plaît Connexion ou Créer un compte à se joindre à la conversation.

    Sauvegarder
    Choix utilisateur pour les Cookies
    Nous utilisons des cookies afin de vous proposer les meilleurs services possibles. Si vous déclinez l'utilisation de ces cookies, le site web pourrait ne pas fonctionner correctement.
    Tout accepter
    Tout décliner
    Essentiel
    Ces cookies sont nécessaires au bon fonctionnement du site, vous ne pouvez pas les désactiver.
    Affichage
    Accepter
    Analytique
    Outils utilisés pour analyser les données de navigation et mesurer l'efficacité du site internet afin de comprendre son fonctionnement.
    Google Analytics
    Accepter
    Décliner