MAY Project Setup » Historique » Révision 24
« Précédent |
Révision 24/74
(diff)
| Suivant »
Anonyme, 09/11/2011 15:25
Draft version...
SpeADL MAY Project SetUp¶
A classic JAVA project to start with...¶
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.
This is necessary in order to...
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.

Maven convertion¶
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.
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:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>XXX</groupId>
<artifactId>XXX</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>fr.irit.smac.may.lib</groupId>
<artifactId>common-components</artifactId>
<version>0.0.3-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>fr.irit.smac</id>
<url>http://www.irit.fr/~Victor.Noel/maven-repos/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src-gen</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Possible issues and resolutions¶
m2e connectors¶
Open your pom.xml file with the Maven POM Editor. In the overview tab, if you get this error:

select buildhelper, then click finish.
Click Next to install m2e connector for build-helper-maven-plugin. Accept the terms of the licence agreements, and the security warning. Restart Eclipse.
Project configuration is not up-to-date¶
You may get an error message saying your project configuration is out of date with your new pom.xml
Update it : right click on your project / Maven / Update Project Configuration...

Proxy and Maven¶
In case you are behind a proxy, Maven may not be able to resolve dependencies.
You might get an error message like "failed to read arfifact descriptor" and "could not calculate build plan".

You have to configure Maven.
Window / Preferences / Maven / User Settings

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.
Edit it like this:
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>XXX</host>
<port>YYY</port>
</proxy>
</proxies>
</settings>
Replace XXX by your proxy URL and YYY by the port used. Ask your administrator if you don't know it.
When it's done, click Browse and select your settings.xml file, then click Update Settings.
This may take some take before the errors disapear, Maven is resolving dependencies and updating the project.
You can track the progression by clicking on thus button, located down in the eclipse interface.

Mis à jour par Anonyme il y a plus de 14 ans · 74 révisions