Projet

Général

Profil

MAY Project Setup » Historique » Version 31

Anonyme, 16/11/2011 15:35

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