Projet

Général

Profil

MAY Project Setup » Historique » Version 46

Anonyme, 20/11/2013 17:19

1 1 Anonyme
*Draft version...*
2
3
h1. SpeADL MAY Project SetUp
4
5 37 Anonyme
_Estimated time: 3 minutes_
6
7 18 Anonyme
h2. A classic JAVA project to start with...
8
9 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.
10 31 Anonyme
This is necessary to benefit from MAY source code generation.
11 1 Anonyme
12 40 Anonyme
Then, create a new file with the speadl extension within the src folder: 
13
14
!https://wwwsecu.irit.fr/redmine/attachments/download/434/new_file_speadl1.png!
15
!https://wwwsecu.irit.fr/redmine/attachments/download/435/new_file_speadl2.png!
16
17
Eclipse will ask you if you want to add Xtext nature to the project, click yes.
18 3 Anonyme
19 2 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/336/add_xtext_nature_confirm.jpg!
20 5 Anonyme
21 42 Anonyme
h2. Using Maven
22 19 Anonyme
23 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.
24 30 Anonyme
You will be asked to create a new POM file. Just click finish and edit it manually like this:
25 5 Anonyme
26 6 Anonyme
<pre>
27 29 Anonyme
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
28
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
29
    <modelVersion>4.0.0</modelVersion>
30
    <groupId>XXX</groupId>
31
    <artifactId>XXX</artifactId>
32
    <version>0.0.1-SNAPSHOT</version>
33
    <dependencies>
34
        <dependency>
35 45 Anonyme
            <groupId>fr.irit.smac.lib.may</groupId> <!-- use fr.irit.smac.may.lib with may v2 -->
36 29 Anonyme
            <artifactId>common-components</artifactId>
37 46 Anonyme
            <version>3.2.0-SNAPSHOT</version> <!-- use 2.1.3 with may v2 -->
38 29 Anonyme
            <type>jar</type>
39
            <scope>compile</scope>
40
        </dependency>
41
    </dependencies>
42
    <repositories>
43
        <repository>
44
            <id>fr.irit.smac</id>
45
            <url>http://www.irit.fr/~Victor.Noel/maven-repos/</url>
46
        </repository>
47
    </repositories>
48
    <build>
49 43 Anonyme
        <sourceDirectory>src</sourceDirectory>
50 1 Anonyme
        <plugins>
51 46 Anonyme
            <plugin>
52
                <artifactId>maven-compiler-plugin</artifactId>
53
                <version>3.1</version>
54
                <configuration>
55
                    <source>1.7</source>
56
                    <target>1.7</target>
57
                </configuration>
58
            </plugin>
59 29 Anonyme
            <plugin>
60
                <groupId>org.codehaus.mojo</groupId>
61
                <artifactId>build-helper-maven-plugin</artifactId>
62
                <version>1.7</version>
63
                <executions>
64
                    <execution>
65
                        <id>add-source</id>
66
                        <phase>generate-sources</phase>
67
                        <goals>
68
                            <goal>add-source</goal>
69
                        </goals>
70
                        <configuration>
71
                            <sources>
72
                                <source>src-gen</source>
73
                            </sources>
74
                        </configuration>
75
                    </execution>
76
                </executions>
77
            </plugin>
78
        </plugins>
79
    </build>
80 6 Anonyme
</project>
81
</pre>
82 5 Anonyme
83 8 Anonyme
h1. Possible issues and resolutions
84
85 10 Anonyme
h2. Project configuration is not up-to-date
86
87 5 Anonyme
You may get an error message saying your project configuration is out of date with your new pom.xml
88 36 Anonyme
Update it : right click on your project / Maven / Update Project Configuration... and click Ok.
89 7 Anonyme
90 1 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg!