Projet

Général

Profil

MAY Maven Standalone Setup » Historique » Révision 2

Révision 1 (Anonyme, 01/10/2014 16:03) → Révision 2/18 (Anonyme, 01/10/2014 16:06)

h1. SpeADL MAY Maven SetUp 

 It The first step is possible to use maven to generate code so that Eclipse is not needed anymore. convert your project into a Maven project. 
 For example, one possible workflow is To do this, right click on your project and on *Configure* / *Convert to use another IDE and executing <pre>mvn generate-sources</pre> after modifying the speadl file. Maven Project*. 

 In order You will be asked to do that, use create a new POM file. Just click *Finish* and edit it as in the following POM file: following: 

 <pre> 
 <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>XXX</version> 

	 
	
	 <properties> 
		 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
		 <xtext-version>2.6.2</xtext-version> 
		 <may-version>3.3.1</may-version> 
		 <may-lib-version>3.3.0</may-lib-version> 
	 </properties> 

	 <dependencies> 
		 <dependency> 
			 <groupId>fr.irit.smac.lib.may</groupId> 
			 <artifactId>common-components</artifactId> 
			 <version>${may-lib-version}</version> 
		 </dependency> 
	 </dependencies> 

	 <repositories> 
		 <repository> 
			 <id>fr.irit.smac</id> 
			 <url>http://www.irit.fr/~Victor.Noel/maven-repos/</url> 
		 </repository> 
	 </repositories> 

	 <build> 
		 <sourceDirectory>src</sourceDirectory> 
		 <plugins> 
			 <plugin> 
				 <artifactId>maven-compiler-plugin</artifactId> 
				 <configuration> 
					 <source>1.7</source> 
					 <target>1.7</target> 
				 </configuration> 
			 </plugin> 
			 <plugin> 
				 <groupId>org.codehaus.mojo</groupId> 
				 <artifactId>build-helper-maven-plugin</artifactId> 
				 <version>1.8</version> 
				 <executions> 
					 <execution> 
						 <id>add-source</id> 
						 <goals> 
							 <goal>add-source</goal> 
						 </goals> 
						 <configuration> 
							 <sources> 
								 <source>speadl-gen</source> 
							 </sources> 
						 </configuration> 
					 </execution> 
					 <!-- The following is only needed so that speadl files are included in the generated maven artifact --> 
					 <execution> 
						 <id>add-resource</id> 
						 <goals> 
							 <goal>add-resource</goal> 
						 </goals> 
						 <configuration> 
							 <resources> 
								 <resource> 
									 <directory>src/main/java</directory> <directory>${project.build.sourceDirectory}</directory> 
									 <includes> 
										 <include>**/*.speadl</include> 
									 </includes> 
								 </resource> 
							 </resources> 
						 </configuration> 
					 </execution> 
				 </executions> 
			 </plugin> 
			 <plugin> 
				 <groupId>org.apache.maven.plugins</groupId> 
				 <artifactId>maven-clean-plugin</artifactId> 
				 <version>2.5</version> 
				 <executions> 
					 <execution> 
						 <!-- hack in order for the file not to be removed on clean but only  
								 prior to code generation from xtext-maven-plugin --> 
						 <phase>generate-sources</phase> 
						 <goals> 
							 <goal>clean</goal> 
						 </goals> 
						 <configuration> 
							 <excludeDefaultDirectories>true</excludeDefaultDirectories> 
							 <filesets> 
								 <fileset> 
									 <directory>speadl-gen</directory> 
								 </fileset> 
							 </filesets> 
						 </configuration> 
					 </execution> 
				 </executions> 
			 </plugin> 
			 <plugin> 
				 <groupId>org.eclipse.xtext</groupId> 
				 <artifactId>xtext-maven-plugin</artifactId> 
				 <version>${xtext-version}</version> 
				 <executions> 
					 <execution> 
						 <goals> 
							 <goal>generate</goal> 
						 </goals> 
					 </execution> 
				 </executions> 
				 <configuration> 
					 <languages> 
						 <language> 
							 <setup>fr.irit.smac.may.speadl.SpeADLStandaloneSetup</setup> 
							 <outputConfigurations> 
								 <outputConfiguration> 
									 <outputDirectory>speadl-gen</outputDirectory> 
								 </outputConfiguration> 
							 </outputConfigurations> 
						 </language> 
					 </languages> 
				 </configuration> 
				 <dependencies> 
					 <dependency> 
						 <groupId>fr.irit.smac.may</groupId> 
						 <artifactId>fr.irit.smac.may.speadl</artifactId> 
						 <version>${may-version}</version> 
					 </dependency> 
				 </dependencies> 
			 </plugin> 
		 </plugins> 
	 </build> 
 </project> 
 </pre>