Projet

Général

Profil

MAY Project Setup » Historique » Version 17

Anonyme, 09/11/2011 10:57

1 1 Anonyme
*Draft version...*
2
3
h1. SpeADL MAY Project SetUp
4
5
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.
6
_This is necessary in order to..._
7
8 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.
9 3 Anonyme
10 2 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/336/add_xtext_nature_confirm.jpg!
11 5 Anonyme
12
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.
13
You will be asked to create a new POM file. Just click finish and edit it manually. A good starting pom.xml for a new project is the following:
14
15 6 Anonyme
<pre>
16
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18
	<modelVersion>4.0.0</modelVersion>
19
	<groupId>XXX</groupId>
20
	<artifactId>XXX</artifactId>
21
	<version>0.0.1-SNAPSHOT</version>
22
	<dependencies>
23
		<dependency>
24
			<groupId>fr.irit.smac.may.lib</groupId>
25
			<artifactId>common-components</artifactId>
26
			<version>0.0.3-SNAPSHOT</version>
27
			<type>jar</type>
28
			<scope>compile</scope>
29
		</dependency>
30
	</dependencies>
31
	<repositories>
32
		<repository>
33
			<id>fr.irit.smac</id>
34
			<url>http://www.irit.fr/~Victor.Noel/maven-repos/</url>
35
		</repository>
36
	</repositories>
37
	<build>
38
		<plugins>
39
			<plugin>
40
				<groupId>org.codehaus.mojo</groupId>
41
				<artifactId>build-helper-maven-plugin</artifactId>
42
				<version>1.7</version>
43
				<executions>
44
					<execution>
45
						<id>add-source</id>
46
						<phase>generate-sources</phase>
47
						<goals>
48
							<goal>add-source</goal>
49
						</goals>
50
						<configuration>
51
							<sources>
52
								<source>src-gen</source>
53
							</sources>
54
						</configuration>
55
					</execution>
56
				</executions>
57
			</plugin>
58
		</plugins>
59
	</build>
60
</project>
61
</pre>
62 5 Anonyme
63 8 Anonyme
h1. Possible issues and resolutions
64
65 10 Anonyme
h2. Project configuration is not up-to-date
66
67 5 Anonyme
You may get an error message saying your project configuration is out of date with your new pom.xml
68
Update it : right click on your project / Maven / Update Project Configuration...
69 7 Anonyme
70 1 Anonyme
!https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg!
71 12 Anonyme
72
h2. Proxy and Maven
73 8 Anonyme
74 13 Anonyme
In case you are behind a proxy, Maven may not be able to resolve dependencies. You have to configure Maven.
75 9 Anonyme
Window / Preferences / Maven / User Settings
76
77
!https://wwwsecu.irit.fr/redmine/attachments/download/338/maven_settings_proxy.jpg!
78
79 15 Anonyme
The settings.xml file located in the indicated directory usually doesn't even exit. Go to this directory and create an empty settings.xml file.
80 9 Anonyme
Edit it like this:
81
82
<pre>
83
<settings>
84
  <proxies>
85
   <proxy>
86
      <active>true</active>
87
      <protocol>http</protocol>
88
      <host>XXX</host>
89
      <port>YYY</port>
90
    </proxy>
91
  </proxies>
92
</settings>
93
</pre>
94
95
Replace XXX by your proxy URL and YYY by the port used. Ask your administrator if you don't know it.
96 17 Anonyme
When it's done, click Browse and select your settings.xml file, then click Update Settings.
97
This may take some take before the errors disapear, Maven is resolving dependencies and updating the project.