Results 1 to 2 of 2

Thread: Maven slice2java plugin

  1. #1
    pkbhavani is offline Registered User
    Name: Praveen Bhavani
    Organization: Saracen Energy
    Project: Global Energy Trading
    Join Date
    Sep 2007
    Posts
    1

    Maven slice2java plugin

    anybody have maven2 plugin written for slice2java

    -Praveen

  2. #2
    urbanq is offline Registered User
    Name: Mathew Urban
    Organization: University of Science & Technology Cracow
    Project: Ice Sale service - using ice technology as server
    Join Date
    Dec 2011
    Posts
    1

    Red face Maven slice2java plugin

    1. I've downloaded ice jars from zeroc.com :
    we need only: ant-ice-3.4.2.jar, Ice-3.4.2.jar.

    2. Add jars to my local maven repository:
    Code:
    mvn install:install-file -Dfile=ant-ice-3.4.2.jar -DgroupId=com.zeroc -DartifactId=ant-ice -Dversion=3.4.2 -Dpackaging=jar
    mvn install:install-file -Dfile=Ice-3.4.2.jar -DgroupId=com.zeroc -DartifactId=ice -Dversion=3.4.2 -Dpackaging=jar -Dsources=Ice-3.4.2.jar
    3. Create pom.xml using ant-run plugin to run slice2java:
    Code:
    <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>my.project.groupId</groupId>
      <artifactId>my.project.artifactId</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <name>my.project.name</name>
    
      <properties>
        <ice.include.path>/usr/share/Ice-3.4.2/slice/Ice</ice.include.path>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>com.zeroc</groupId>
          <artifactId>ice</artifactId>
          <version>3.4.2</version>
        </dependency>
      </dependencies>
    
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <configuration>
                  <target name="slice2java">
                    <taskdef name="slice2java" classname="Slice2JavaTask" classpathref="maven.plugin.classpath" />
                    <slice2java outputdir="src/generated/java">
                      <fileset dir="src/main/resources" includes="fileSystem.ice sale.ice" />
                      <includepath>
                        <pathelement path="${ice.include.path}" />
                      </includepath>
                    </slice2java>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.zeroc</groupId>
                <artifactId>ant-ice</artifactId>
                <version>3.4.2</version>
              </dependency>
            </dependencies>
          </plugin>
          <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/generated/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
    * I added "ice.include.path" property because I'm using #include <BuiltinSequences.ice> in my *.ice definitions
    ** build-helper-maven-plugin add generated sources to compile process

    Hope it will help you!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 07-12-2009, 01:44 PM
  2. is there a Ice Maven Integration?
    By martind in forum Help Center
    Replies: 2
    Last Post: 03-29-2009, 12:07 PM
  3. Slice2Java plugin doesn't work with Ice 3.3.0
    By gsteele9 in forum Help Center
    Replies: 3
    Last Post: 03-03-2009, 09:37 AM
  4. Eclipse slice2java plugin -- initial impressions
    By mefoster in forum Bug Reports
    Replies: 3
    Last Post: 02-09-2009, 03:09 PM
  5. Replies: 0
    Last Post: 12-22-2008, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •