MAY Project Setup » Historique » Version 23
Anonyme, 09/11/2011 15:24
| 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 | _This is necessary in order to..._ |
||
| 9 | |||
| 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 | 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: |
||
| 18 | |||
| 19 | 6 | Anonyme | <pre> |
| 20 | <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-SNAPSHOT</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 | <plugins> |
||
| 43 | <plugin> |
||
| 44 | <groupId>org.codehaus.mojo</groupId> |
||
| 45 | <artifactId>build-helper-maven-plugin</artifactId> |
||
| 46 | <version>1.7</version> |
||
| 47 | <executions> |
||
| 48 | <execution> |
||
| 49 | <id>add-source</id> |
||
| 50 | <phase>generate-sources</phase> |
||
| 51 | <goals> |
||
| 52 | <goal>add-source</goal> |
||
| 53 | </goals> |
||
| 54 | <configuration> |
||
| 55 | <sources> |
||
| 56 | <source>src-gen</source> |
||
| 57 | </sources> |
||
| 58 | </configuration> |
||
| 59 | </execution> |
||
| 60 | </executions> |
||
| 61 | </plugin> |
||
| 62 | </plugins> |
||
| 63 | </build> |
||
| 64 | </project> |
||
| 65 | </pre> |
||
| 66 | 5 | Anonyme | |
| 67 | 8 | Anonyme | h1. Possible issues and resolutions |
| 68 | |||
| 69 | 23 | Anonyme | h2. m2e connectors |
| 70 | |||
| 71 | If you get this error: |
||
| 72 | |||
| 73 | !https://wwwsecu.irit.fr/redmine/attachments/download/344/me2_connectors.jpg! |
||
| 74 | |||
| 75 | select buildhelper, then click finish. |
||
| 76 | |||
| 77 | Click Next to install m2e connector for build-helper-maven-plugin. Accept the terms of the licence agreements, and the security warning. Restart Eclipse. |
||
| 78 | |||
| 79 | 10 | Anonyme | h2. Project configuration is not up-to-date |
| 80 | |||
| 81 | 5 | Anonyme | You may get an error message saying your project configuration is out of date with your new pom.xml |
| 82 | Update it : right click on your project / Maven / Update Project Configuration... |
||
| 83 | 7 | Anonyme | |
| 84 | 1 | Anonyme | !https://wwwsecu.irit.fr/redmine/attachments/download/337/update_project_conf.jpg! |
| 85 | 12 | Anonyme | |
| 86 | h2. Proxy and Maven |
||
| 87 | 8 | Anonyme | |
| 88 | 20 | Anonyme | In case you are behind a proxy, Maven may not be able to resolve dependencies. |
| 89 | You might get an error message like "failed to read arfifact descriptor" and "could not calculate build plan". |
||
| 90 | 21 | Anonyme | |
| 91 | !https://wwwsecu.irit.fr/redmine/attachments/download/340/proxy_issue.jpg! |
||
| 92 | |||
| 93 | 20 | Anonyme | You have to configure Maven. |
| 94 | 9 | Anonyme | Window / Preferences / Maven / User Settings |
| 95 | |||
| 96 | !https://wwwsecu.irit.fr/redmine/attachments/download/338/maven_settings_proxy.jpg! |
||
| 97 | |||
| 98 | 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. |
| 99 | 9 | Anonyme | Edit it like this: |
| 100 | |||
| 101 | <pre> |
||
| 102 | <settings> |
||
| 103 | <proxies> |
||
| 104 | <proxy> |
||
| 105 | <active>true</active> |
||
| 106 | <protocol>http</protocol> |
||
| 107 | <host>XXX</host> |
||
| 108 | <port>YYY</port> |
||
| 109 | </proxy> |
||
| 110 | </proxies> |
||
| 111 | </settings> |
||
| 112 | </pre> |
||
| 113 | |||
| 114 | Replace XXX by your proxy URL and YYY by the port used. Ask your administrator if you don't know it. |
||
| 115 | 17 | Anonyme | When it's done, click Browse and select your settings.xml file, then click Update Settings. |
| 116 | This may take some take before the errors disapear, Maven is resolving dependencies and updating the project. |
||
| 117 | 22 | Anonyme | You can track the progression by clicking on thus button, located down in the eclipse interface. |
| 118 | |||
| 119 | !https://wwwsecu.irit.fr/redmine/attachments/download/341/updating.jpg! |