Surya \’s Blog

… ever streaming tools and technologies….!!!

How to get started AndroMDA – in brief

Posted by kathayat on July 10, 2007

A: Set up Configuration

1. Download and Install/Configure – AndroMDA, Maven, JBoss, MagicDraw, Databases, Eclipse [http://galaxy.andromda.org/index.php?option=com_content&task=view&id=105&Itemid=89]

2. Set Environment Variables
 JAVA_HOME=;  JBOSS_HOME= ;  M2_HOME=;  M2_REPO=;  PATH=%JAVA_HOME%\bin;%M2_HOME%\bin; etc

3.  Create the temporary project using the following command
mvn archetype:create -DgroupId=testapp -DartifactId=testapp
Make sure “Build Successful” message appears at the end and verify that the temporary project is created in the current directory and in the repository. You can delete the temporary project you have just created.

4.  Download AndroMDA maven plug-in and extract it to the repository that you set in SETP 2 above.

5.  Create “pom.xml” file in any temporary directory. Issue the “mvn” command from the command line inside that temporary directory and make sure “Build Successful” message appears at the end.

Contents of pom.xml

<project>

    <modelVersion>4.0.0</modelVersion>
    <groupId>samples.test</groupId>
    <artifactId>test</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <name>test</name>

    <build>
        <defaultGoal>compile</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.andromda.maven.plugins</groupId>
                <artifactId>andromdapp-maven-plugin</artifactId>
                <version>3.2</version>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>andromda</id>
            <name>AndroMDA Repository</name>
            <url>http://team.andromda.org/maven2</url&gt;
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>andromda</id>
            <name>AndroMDA Repository</name>
            <url>http://team.andromda.org/maven2</url&gt;
        </pluginRepository>
    </pluginRepositories>

</project>

B: Starting a Project

6. Issue the following command (may differ according to the andromeda plug-in version) from any directory where you want to create your project.
mvn org.andromda.maven.plugins:andromdapp-maven-plugin:3.2:generate
Configure your application answering several on-screen questions. For reference – refer to page [http://galaxy.andromda.org/index.php?option=com_content&task=view&id=107&Itemid=89]. Make sure that “build successful” message should appear at the end.

7. Configure the generated files. Refer [http://galaxy.andromda.org/index.php?option=com_content&task=view&id=107&Itemid=89]

a. Configure Database drivers, usernames, passwords, app server version
b. Configure Repositories etc

1. mda/src/main/config/andromda.xml
a. Update EnableSpringTransactionsWhenEjbsEnabled == false
b. Add property in bpm4struts namespace “<property name=”normalizeMessages”>true</property>”
2. /pom.xml
a. Update jdbc driver (what version of driver you have in your system) <jdbc.driver.jar>${jboss.home}/server/default/lib/mysql-connector-java-5.0.4.jar</jdbc.driver.jar
b. Update username and password (database) ..simple search for work ‘username’ and update
c. Update repositories
    <repositories>
        <repository>
            <id>andromda</id>
            <name>AndroMDA Repository</name>
            <url>http://team.andromda.org/maven2</url&gt;
        </repository>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven 2</name>
            <url>https://maven2-repository.dev.java.net/nonav/repository</url&gt;
            <layout>default</layout>
        </repository>
    </repositories>
d. Comment out ‘junit’ dependency and add ‘testng’ dependencies (this is for unit testing with ‘testng’.
<dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>4.7</version>
            <scope>test</scope>
            <classifier>jdk15</classifier>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.0.4</version>
            <scope>test</scope>
        </dependency>
e. Copy(if you have template)/Create Test directory to Core/src directory
f. Search for word ‘maven-resources-plugin’ and add other plugins below its section.
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>
                <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <version>2.2</version>
                   <configuration>
                     <suiteXmlFiles>
                       <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                     </suiteXmlFiles>
                   </configuration>
                </plugin>

8. Open the generated UML project (yourapp/mda/src/main/uml/yourapp.xml) from MagicDraw and export it to the same location. Then issue the command “mvn install” from the command line (inside ‘yourapp’ directory) and make sure that “build successful” message appears at the end.

9. Start your real work – create models, packages, services, use case diagrams, activity diagrams etc in the MagicDraw according to the needs of your application and then export it to the project directory again. Finally generate code and edit if necessary…happy coding!!!
a. Create Model
b. Create root package inside model
c. Create ‘vo’ subpackage and add class diagram and create the valued object class (say UserVO)
d. Create ‘service’ subpackage and add class diagram and create service class (say UserService)
e. Create the  ‘domain’ subpackage and add class diagrams for domain objects (entities).
f. Define the dependencies between the value objects and entities
g. Define the dependencies between services and entities

10.  Build common and web projects and deploy
a. Edit deploy configuration in web/pom.xml
b. mvn -f common/pom.xml install and mvn -f web/pom.xml install
c. Run Jboss
d. mvn -f app/pom.xml -Ddeploy (if you creating war file….use mvn -f web/pom.xml instead)


NOTE for Eclipse Users: Open the AndroMDA generated .classpath file. Note that AndroMDA does not add TestNG to the classpath. Add the following entry to this file to make sure TestNG is in the classpath. Furthermore, if you do not want AndroMDA to overwrite the modified .classpath file, simply disable its generation by commenting out the andromdapp-maven-plugin section in mda\pom.xml.

<classpathentry kind=”var” path=”M2_REPO/org/testng/testng/4.7/testng-4.7-jdk15.jar”/>

or modify that plugin section as below

         <plugin>
            <groupId>org.andromda.maven.plugins</groupId>
            <artifactId>andromdapp-maven-plugin</artifactId>
            <executions>
               <execution>
                  <goals>
                     <goal>eclipse</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <excludes>
                  <exclude>mda/pom.xml</exclude>
               </excludes>
               <classpathMerge>
                  <![CDATA[
                    <classpathentry kind=”var” path=”M2_REPO/org/testng/testng/4.7/testng-4.7-jdk15.jar”/>
                  <classpathentry kind=”src” path=”core/target/test-src”/>
                  ]]>
               </classpathMerge>
            </configuration>
         </plugin>

Advertisements

9 Responses to “How to get started AndroMDA – in brief”

  1. brown said

    aH1Ctp sd80347yv35t8574dcu0r

  2. thanks,very useful and it works

  3. anitha1234 said

    Best Software Downloads and Reviews. the most comprehensive source for free-to-trysoftware downloads on the WebBEST 4 DOWNLOADS

  4. hosting
    Poszukujesz łatwego i taniego wyjścia, iżby podwyższyć zyski osobistej firmy? Posiadam z tej przyczyny dla Ciebie inteligentne podejście. Marketing. Wiem, miało być niedrogo, aliści daję Ci pewność, że będzie. Najłatwiejszą i w największym stopniu zupełną, acz naraz w najwyższym stopniu skuteczną postacią reklamy jest strona internetowa. W tym momencie, jeśli Twojej jednostki biznesowej nie ma w Internecie to możesz zapomnieć o sporych przychodach. Każdy wypatruje na początku w sieci, dopiero potem potencjalnie sięga po gazetę, czy pyta przyjaciół. Zerknijmy prawdzie w oczy, strona WWW jest właściwie pomocna. Jeżeli nie jesteś ocykany w materiach domen i Netu nie martw się. Nasza jednostka biznesowa stanęła zatem specjalnie dla Ciebie. Świadczymy usługi z obrębu hosting od zainicjowania do finału. Nasi koneserzy odpowiedzą na Twoje wszelkie zapytania i pomogą dobrać w najwyższym stopniu optymalną ofertę dla Ciebie. Dzięki nam zdołasz podwyższyć przychody swojej firmy przy ściśle mówiąc mizernym nakładzie finansowym. Jakim sposobem? Z powodu usługi hosting. Zaznajomisz się w tym miejscu z kompletną ofertą na hosting i wykryjesz dane do kontaktu z nami. Sprawdź w jaki sposób Net może Cię wesprzeć.

  5. system-erp said

    Unquestionably believe that which you said. Your favorite justification appeared to be
    on the web the simplest thing to be aware of. I
    say to you, I definitely get annoyed while people think about worries that they plainly do not know about.

    You managed to hit the nail upon the top as well as defined out the whole thing without having side-effects , people can take a signal.
    Will likely be back to get more. Thanks

  6. You know from the initial few minutes whether you’re drawn to them or not. However not all cases of domestic abuse have happy endings. Other main features are.

  7. Howdy! I understand this is sort of off-topic but I had
    to ask. Does building a well-established blog like yours require a
    massive amount work? I am brand new to blogging however I do write in my journal
    on a daily basis. I’d like to start a blog so I can easily share my experience and views online. Please let me know if you have any recommendations or tips for brand new aspiring blog owners. Thankyou!

  8. EdmondPurn said

    you jizz mobile – youjizz french, mobile you jizz.

  9. Lately I was constantly searching Yahoo hoping to find blogs
    with info on wp website builder and discovered https://kathayat.wordpress.com/2007/07/10/how-to-get-started-andromda-in-brief/.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: