The Artima Developer Community
Sponsored Link

Java Buzz Forum
Maven + J2ME Polish (part 1)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Wilfred Springer

Posts: 176
Nickname: springerw
Registered: Sep, 2006

Wilfred Springer is a Software Architect at Xebia
Maven + J2ME Polish (part 1) Posted: Jul 15, 2008 3:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Wilfred Springer.
Original Post: Maven + J2ME Polish (part 1)
Feed Title: Distributed Reflections of the Third Kind
Feed URL: http://agilejava.com/blog/?feed=atom
Feed Description: Distributed Reflections of the Third Kind
Latest Java Buzz Posts
Latest Java Buzz Posts by Wilfred Springer
Latest Posts From Distributed Reflections of the Third Kind

Advertisement

The question I am trying to answer today, is if it would be possible to have a decent multi module build based on Maven and J2ME Polish.

Combining the two seems to require something like cold fusion; they both try to control the entire build lifecycle.

So, here are some of my first conclusions.

Just running the J2ME Polish build from Maven is easy. You just plug in the maven-ant-run plugin, and it just works:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <tasks>
                <ant antfile=\"build.xml\" target=\"j2mepolish\"/>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>

So, that sort of works. But is it also desirable. That’s hard to tell. At this stage, the pom.xml file controls J2ME Polish. I already pull in dependencies in the pom using the Ant tasks for Maven (see below). However, if the pom.xml file’s packaging type is set to jar, and if you have set your source directory to point to the actual location of your sources, your build will fail if you use J2ME Polish’ preprocessing directives.

  <typedef resource=\"org/apache/maven/artifact/ant/antlib.xml\"
           uri=\"urn:maven-artifact-ant\"
           classpath=\"antlib/maven-ant-tasks-2.0.9.jar\"/>
	
  <artifact:pom id=\"maven.project\" file=\"pom.xml\"/>
	
  <artifact:dependencies pomRefId=\"maven.project\"
                         filesetId=\"dependency.fileset\"/>
	
  <artifact:dependencies pomRefId=\"maven.project\"
                         filesetId=\"test.dependency.fileset\"
                         useScope=\"test\"/>

The easy way out is to set packaging type to pom. Quite to my surprise, that actually works. I expected the Maven Eclipse Plugin to basically ignore this project and its source directories. (I think I remember this is the way it used to work in the past.)

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <additionalProjectnatures>
            <projectNature>de.enough.mepose.core.polishNature</projectNature>
          </additionalProjectnatures>
        </configuration>
      </plugin>

But let’s not get too excited; this is just a single module build.

Read: Maven + J2ME Polish (part 1)

Topic: links for 2008-07-07 from PeopleOverProcess.com Previous Topic   Next Topic Topic: FriendFeed Favors 9 Elites To Gain Maximum Followers?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use