Projet

Général

Profil

MAY Project Setup » Historique » Version 32

Anonyme, 16/11/2011 15:36

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