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

Trouble with the Ultimate Maven POM,solutions here

More
12 years 5 months ago - 12 years 5 months ago #23 by mseguy
: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
    This email address is being protected from spambots. You need JavaScript enabled to view it.
    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: 12 years 5 months ago by mseguy.

    Please Log in or Create an account to join the conversation.

    Save
    Cookies user preferences
    We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
    Accept all
    Decline all
    Essential
    These cookies are needed to make the website work correctly. You can not disable them.
    Affichage
    Accept
    Analytics
    Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
    Google Analytics
    Accept
    Decline