Projet

Général

Profil

MAY Project Setup » Historique » Version 47

Anonyme, 13/12/2013 17:20

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 47 Anonyme
First, create a java project, choose a name, and click finish.
10 1 Anonyme
11 40 Anonyme
Then, create a new file with the speadl extension within the src folder: 
12
13
!https://wwwsecu.irit.fr/redmine/attachments/download/434/new_file_speadl1.png!
14
!https://wwwsecu.irit.fr/redmine/attachments/download/435/new_file_speadl2.png!
15 5 Anonyme
16 1 Anonyme
h2. Using Maven
17
18
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
You will be asked to create a new POM file. Just click finish and edit it manually like this:
20
21
<pre>
22 47 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
	
29
	<build>
30
		<sourceDirectory>src</sourceDirectory>
31
		<plugins>
32
			<plugin>
33
				<artifactId>maven-compiler-plugin</artifactId>
34
				<version>3.1</version>
35
				<configuration>
36
					<source>1.7</source>
37
					<target>1.7</target>
38
				</configuration>
39
			</plugin>
40
			<plugin>
41
				<groupId>org.codehaus.mojo</groupId>
42
				<artifactId>build-helper-maven-plugin</artifactId>
43
				<version>1.8</version>
44
				<executions>
45
					<execution>
46
						<id>add-source</id>
47
						<phase>generate-sources</phase>
48
						<goals>
49
							<goal>add-source</goal>
50
						</goals>
51
						<configuration>
52
							<sources>
53
								<source>speadl-gen</source>
54
							</sources>
55
						</configuration>
56
					</execution>
57
					<!-- The following is only needed so that speadl files are included in the generated maven artifact -->
58
					<execution>
59
						<id>add-resource</id>
60
						<goals>
61
							<goal>add-resource</goal>
62
						</goals>
63
						<configuration>
64
							<resources>
65
								<resource>
66
									<directory>${project.build.sourceDirectory}</directory>
67
									<includes>
68
										<include>**/*.speadl</include>
69
									</includes>
70
								</resource>
71
							</resources>
72
						</configuration>
73
					</execution>
74
				</executions>
75
			</plugin>
76
		</plugins>
77
	</build>
78
79
	<dependencies>
80
		<dependency>
81
			<groupId>fr.irit.smac.lib.may</groupId>
82
			<artifactId>common-components</artifactId>
83
			<version>3.2.1</version>
84
		</dependency>
85
	</dependencies>
86
87
	<repositories>
88
		<repository>
89
			<id>fr.irit.smac</id>
90
			<url>http://www.irit.fr/~Victor.Noel/maven-repos/</url>
91
		</repository>
92
	</repositories>
93 29 Anonyme
</project>
94
</pre>
95 6 Anonyme
96
h1. Possible issues and resolutions
97 47 Anonyme
98
h2. 
99 8 Anonyme
100 10 Anonyme
h2. Project configuration is not up-to-date
101
102 5 Anonyme
You may get an error message saying your project configuration is out of date with your new pom.xml
103 36 Anonyme
Update it : right click on your project / Maven / Update Project Configuration... and click Ok.
104 7 Anonyme
105 1 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg!