Projet

Général

Profil

MAY Project Setup » Historique » Version 39

Anonyme, 18/11/2011 14:29

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