Projet

Général

Profil

MAY Project Setup » Historique » Version 37

Anonyme, 16/11/2011 15:41

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 32 Anonyme
Create a folder main in the src folder, and then create a folder java in the main folder (Maven convention)
13 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.
14 3 Anonyme
15 2 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/336/add_xtext_nature_confirm.jpg!
16 5 Anonyme
17 34 Anonyme
Your package explorer should looks like this:
18 35 Anonyme
19 34 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/352/package_explorer.jpg!
20
21 19 Anonyme
h2. Maven convertion
22
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
            <groupId>fr.irit.smac.may.lib</groupId>
36
            <artifactId>common-components</artifactId>
37
            <version>0.0.3</version>
38
            <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
    	<sourceDirectory>src</sourceDirectory>
50
        <plugins>
51
            <plugin>
52
                <groupId>org.codehaus.mojo</groupId>
53
                <artifactId>build-helper-maven-plugin</artifactId>
54
                <version>1.7</version>
55
                <executions>
56
                    <execution>
57
                        <id>add-source</id>
58
                        <phase>generate-sources</phase>
59
                        <goals>
60
                            <goal>add-source</goal>
61
                        </goals>
62
                        <configuration>
63
                            <sources>
64
                                <source>src-gen</source>
65
                            </sources>
66
                        </configuration>
67
                    </execution>
68
                </executions>
69
            </plugin>
70
        </plugins>
71
    </build>
72 6 Anonyme
</project>
73
</pre>
74 5 Anonyme
75 8 Anonyme
h1. Possible issues and resolutions
76
77 10 Anonyme
h2. Project configuration is not up-to-date
78
79 5 Anonyme
You may get an error message saying your project configuration is out of date with your new pom.xml
80 36 Anonyme
Update it : right click on your project / Maven / Update Project Configuration... and click Ok.
81 7 Anonyme
82 1 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg!