Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Acceleo/Maven"

m (New Maven Build)
(First major version of the uml stand alone build.)
Line 1: Line 1:
=Maven Integration=
+
= Maven Integration =
 +
Launch this with the following command: mvn clean org.eclipse.acceleo:maven:3.2.1:acceleo-compile compile verify
  
/!\ currently being written for the Eclipse 4.2 Juno release /!\
+
The header of a regular maven pom.xml file.
  
== Old Maven Build ==
+
  <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>
  
The old maven build is based on a call to a Java class used to launch a stand alone Acceleo compilation.
+
The information of the project to build.
  
=== Example ===
+
    <groupId>org.eclipse.acceleo</groupId>
An example of this maven integration can be found in the UML to Java generator available on Github.
+
    <artifactId>maven-test</artifactId>
 +
    <version>3.2.1</version>
 +
    <packaging>jar</packaging>
 +
    <name>org.eclipse.acceleo.maven.tests</name>
 +
    <description>The Acceleo maven tests plugin.</description>   
  
== New Maven Build ==
+
The repositories to use for the dependencies of this project (ex: org.eclipse.uml2.uml).
  
The new maven build is using a maven based plugin that can be integrated seamlessly in a maven based workflow.
+
    <repositories>
 +
      <repository>
 +
        <id>Indigo Release</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
 +
      </repository>
 +
      <repository>
 +
        <id>Juno Release</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
 +
      </repository>
 +
      <repository>
 +
        <id>Snapshots</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
 +
      </repository>
 +
    </repositories>
  
=== Example ===
+
The repositories where the plugin used during the build will be found (ex: org.eclipse.acceleo.maven).
  
An example is currently being created
+
    <pluginRepositories>
 +
      <pluginRepository>
 +
        <id>Indigo Release</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
 +
      </pluginRepository>
 +
      <pluginRepository>
 +
        <id>Juno Release</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
 +
      </pluginRepository>
 +
      <pluginRepository>
 +
        <id>Snapshots</id>
 +
        <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
 +
      </pluginRepository>
 +
    </pluginRepositories>
 +
 
 +
The dependencies used to build. Here, the Acceleo maven plugin, the two plugins needed for the UML meta-model and log4j.
 +
 
 +
    <dependencies>
 +
      <dependency>
 +
        <groupId>org.eclipse.acceleo</groupId>
 +
        <artifactId>maven</artifactId>
 +
        <version>3.2.1</version>
 +
      </dependency>
 +
      <dependency>
 +
        <groupId>org.eclipse.uml2</groupId>
 +
        <artifactId>uml</artifactId>
 +
        <version>3.2.1</version>
 +
      </dependency>
 +
      <dependency>
 +
        <groupId>org.eclipse.uml2</groupId>
 +
        <artifactId>common</artifactId>
 +
        <version>1.6.0</version>
 +
      </dependency>
 +
      <dependency>
 +
        <groupId>org.slf4j</groupId>
 +
        <artifactId>slf4j-simple</artifactId>
 +
        <version>1.6.4</version>
 +
      </dependency>
 +
    </dependencies>
 +
 
 +
The configuration of the Acceleo build.
 +
 
 +
    <build>
 +
      <plugins>
 +
        <plugin>
 +
          <groupId>org.eclipse.acceleo</groupId>
 +
          <artifactId>maven</artifactId>
 +
          <version>3.2.1</version>
 +
          <executions>
 +
            <execution>
 +
              <phase>compile</phase>
 +
            </execution>
 +
          </executions>
 +
          <configuration>
 +
            <useBinaryResources>false</useBinaryResources>
 +
            <usePlatformResourcePath>true</usePlatformResourcePath>
 +
            <acceleoProject>
 +
              <root>${project.basedir}</root>
 +
              <entries>
 +
                <entry>
 +
                  <input>src/main/java</input>
 +
                  <output>target/classes</output>
 +
                </entry>
 +
              </entries>
 +
            </acceleoProject>
 +
            <packagesToRegister>
 +
              <packageToRegister>org.eclipse.uml2.uml.UMLPackage</packageToRegister>
 +
            </packagesToRegister>
 +
          </configuration>
 +
        </plugin>
 +
      </plugins>
 +
    </build>
 +
  </project>

Revision as of 09:10, 8 June 2012

Maven Integration

Launch this with the following command: mvn clean org.eclipse.acceleo:maven:3.2.1:acceleo-compile compile verify

The header of a regular maven pom.xml file.

 <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>

The information of the project to build.

   <groupId>org.eclipse.acceleo</groupId>
   <artifactId>maven-test</artifactId>
   <version>3.2.1</version>
   <packaging>jar</packaging>
   <name>org.eclipse.acceleo.maven.tests</name>
   <description>The Acceleo maven tests plugin.</description>    

The repositories to use for the dependencies of this project (ex: org.eclipse.uml2.uml).

   <repositories>
     <repository>
       <id>Indigo Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
     </repository>
     <repository>
       <id>Juno Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
     </repository>
     <repository>
       <id>Snapshots</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
     </repository>
   </repositories>

The repositories where the plugin used during the build will be found (ex: org.eclipse.acceleo.maven).

   <pluginRepositories>
     <pluginRepository>
       <id>Indigo Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
     </pluginRepository>
     <pluginRepository>
       <id>Juno Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
     </pluginRepository>
     <pluginRepository>
       <id>Snapshots</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
     </pluginRepository>
   </pluginRepositories>

The dependencies used to build. Here, the Acceleo maven plugin, the two plugins needed for the UML meta-model and log4j.

   <dependencies>
     <dependency>
       <groupId>org.eclipse.acceleo</groupId>
       <artifactId>maven</artifactId>
       <version>3.2.1</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.uml2</groupId>
       <artifactId>uml</artifactId>
       <version>3.2.1</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.uml2</groupId>
       <artifactId>common</artifactId>
       <version>1.6.0</version>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-simple</artifactId>
       <version>1.6.4</version>
     </dependency>
   </dependencies>

The configuration of the Acceleo build.

   <build>
     <plugins>
       <plugin>
         <groupId>org.eclipse.acceleo</groupId>
         <artifactId>maven</artifactId>
         <version>3.2.1</version>
         <executions>
           <execution>
             <phase>compile</phase>
           </execution>
         </executions>
         <configuration>
           <useBinaryResources>false</useBinaryResources>
           <usePlatformResourcePath>true</usePlatformResourcePath>
           <acceleoProject>
             <root>${project.basedir}</root>
             <entries>
               <entry>
                 <input>src/main/java</input>
                 <output>target/classes</output>
               </entry>
             </entries>
           </acceleoProject>
           <packagesToRegister>
             <packageToRegister>org.eclipse.uml2.uml.UMLPackage</packageToRegister>
           </packagesToRegister>
         </configuration>
       </plugin>
     </plugins>
   </build>
 </project>

Back to the top