Projet

Général

Profil

MAY Project Setup » Historique » Version 34

Anonyme, 16/11/2011 15:39

1 1 Anonyme
*Draft version...*
2
3
h1. SpeADL MAY Project SetUp
4
5 18 Anonyme
h2. A classic JAVA project to start with...
6
7 1 Anonyme
First, create a java project, choose a name, and click finish. Add the SpeADL Nature to the project : right click on the project / Configure / Add SpeADL Nature.
8 31 Anonyme
This is necessary to benefit from MAY source code generation.
9 1 Anonyme
10 32 Anonyme
Create a folder main in the src folder, and then create a folder java in the main folder (Maven convention)
11 33 Anonyme
Then, create a new file with the speadl extension within the java folder. Eclipse will ask you if you want to add Xtext nature to the project, click yes.
12 3 Anonyme
13 2 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/336/add_xtext_nature_confirm.jpg!
14 5 Anonyme
15 34 Anonyme
Your package explorer should looks like this:
16
!https://wwwsecu.irit.fr/redmine/attachments/download/352/package_explorer.jpg!
17
18 19 Anonyme
h2. Maven convertion
19
20 5 Anonyme
The next step is to convert your project into a Maven project. To do this, right click on your project / Configure / Convert to Maven Project.
21 30 Anonyme
You will be asked to create a new POM file. Just click finish and edit it manually like this:
22 5 Anonyme
23 6 Anonyme
<pre>
24 29 Anonyme
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
25
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26
    <modelVersion>4.0.0</modelVersion>
27
    <groupId>XXX</groupId>
28
    <artifactId>XXX</artifactId>
29
    <version>0.0.1-SNAPSHOT</version>
30
    <dependencies>
31
        <dependency>
32
            <groupId>fr.irit.smac.may.lib</groupId>
33
            <artifactId>common-components</artifactId>
34
            <version>0.0.3</version>
35
            <type>jar</type>
36
            <scope>compile</scope>
37
        </dependency>
38
    </dependencies>
39
    <repositories>
40
        <repository>
41
            <id>fr.irit.smac</id>
42
            <url>http://www.irit.fr/~Victor.Noel/maven-repos/</url>
43
        </repository>
44
    </repositories>
45
    <build>
46
    	<sourceDirectory>src</sourceDirectory>
47
        <plugins>
48
            <plugin>
49
                <groupId>org.codehaus.mojo</groupId>
50
                <artifactId>build-helper-maven-plugin</artifactId>
51
                <version>1.7</version>
52
                <executions>
53
                    <execution>
54
                        <id>add-source</id>
55
                        <phase>generate-sources</phase>
56
                        <goals>
57
                            <goal>add-source</goal>
58
                        </goals>
59
                        <configuration>
60
                            <sources>
61
                                <source>src-gen</source>
62
                            </sources>
63
                        </configuration>
64
                    </execution>
65
                </executions>
66
            </plugin>
67
        </plugins>
68
    </build>
69 6 Anonyme
</project>
70
</pre>
71 5 Anonyme
72 8 Anonyme
h1. Possible issues and resolutions
73
74 10 Anonyme
h2. Project configuration is not up-to-date
75
76 5 Anonyme
You may get an error message saying your project configuration is out of date with your new pom.xml
77
Update it : right click on your project / Maven / Update Project Configuration...
78 7 Anonyme
79 1 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg!