Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    A Call to Maven Users

    The first iteration of a mavenizer, whose history is documented in this forum post and this wiki page, to this point has been too difficult to maintain / collaborate on. The short of it is that I've gone ahead and written a Maven plugin that does pretty much the same thing, with a few improvements (I hope they're improvements). Wiki documentation will be updated in the near-term, but I'm asking the community to test what I have before I invest the time and energy to write it all up comprehensively. Meanwhile, here's what I think you might need to know to get started:
    • LGPL licenses are now supported.
    • The groupId has changed to com.isomorphic.smartgwt.
    • Some of the artifactIds have changed slightly. You shouldn't have much trouble figuring out what's available, but note that I tried to stick to the convention where client-side artifacts are prefixed with "smartgwt", and server-side with "isomorphic".
    • Version numbers have changed slightly, to take the form major.minor-[d|p]yyyyMMdd. As there is now a patch release available the day after the initial release, there is only support for nightly builds. i.e., you'll have to hack a little bit to get a production release without a 'pyyyyMMdd' classifier.
    • I changed some of the dependencies a bit, taking a guess at which dependencies were direct and which were transitive. More accurately, if a dependency was available transitively, it should now be resolved that way. It all seems to work with the showcase app, but I would appreciate some feedback on the POMs themselves (especially from Analytics, Messaging, Hibernate and JPA users).
    • Source is finally in a googlecode SVN repo. Find the project's home page at http://code.google.com/p/smartgwt-maven-plugin/.
    • The plugin is versioned to track along with SmartGWT releases (2.5p through 4.1d), such that e.g., a 3.0p user should use plugin version 3.0 and a 4.1d user should use the 4.1-SNAPSHOT release. Snapshot releases can be found at https://oss.sonatype.org/content/rep...ies/snapshots/. Production releases are normally released to a staging repository before they are synched to central. The current staging release (4.0p) can be found at https://oss.sonatype.org/content/rep...n-plugin-1007/
    • Some of the command line parameters have changed, but the main uses cases can be fulfilled with the following:


    Example Configuration (~/.m2/settings.xml)
    Code:
    <profile>
        <id>isc</id>
        <properties>
            <isc.username>YOUR_SMARTCLIENT_USERNAME</isc.username>
            <isc.password>YOUR_SMARTCLIENT_PASSWORD</isc.password>
            <license>ENTERPRISE</license>
            <!--
            <license>LGPL</license>
            <license>EVAL</license>
            <license>PRO</license>
            <license>POWER</license>
            <license>ENTERPRISE</license>
            -->
            <!-- set to true if optional analytics has been licensed with power/enterprise -->
            <analytics>false</analytics>
            <!-- set to true if optional messaging has been licensed with power/enterprise -->
            <messaging>false</messaging>
    
            <!-- to deploy the smartgwt artifacts to some corporate repo via deploy goal -->
            <!--
            <repository.id>corporate-nexus</repository.id>
            <repository.url>http://localhost:9081/nexus/content/repositories/thirdparty/</repository.url>
            -->
        </properties>
    
        <!-- configuration providing access to staging repos -->
        <pluginRepositories>
            <pluginRepository>
                <id>sonatype-staging</id>
    	    <name>Sonatype Staged Release</name>
    	    <releases>
    	      <enabled>true</enabled>
    	    </releases>
    	    <snapshots>
    	      <enabled>false</enabled>
    	    </snapshots>
    	    <url>https://oss.sonatype.org/content/repositories/comgooglecodesmartgwt-maven-plugin-1007/</url>
    	    <layout>default</layout>
    	</pluginRepository>
            <pluginRepository>
                <id>sonatype-snapshots</id>
                <name>Sonatype Release Snapshots</name>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                <layout>default</layout>
            </pluginRepository>
        </pluginRepositories>
    </profile>
    <pluginGroups>
        <pluginGroup>com.googlecode.smartgwt-maven-plugin</pluginGroup>
    </pluginGroups>
    Installation
    Code:
    //use a plugin version other than the latest (currently 3.1) to be downloaded / installed locally (requires fully qualified group and artifact id)
    mvn com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:3.0:install -Pisc
    Example usage
    Code:
    //install today's build
    mvn smartgwt:install -Pisc
      
    //install and deploy today's build
    mvn smartgwt:deploy -Pisc
    
    //install the 1/1/2013 build
    mvn smartgwt:install -Pisc -Dbuild.date=2013-01-01
    
    //install the 1/1/2013 build again, overwriting whatever was there before (useful after an interrupted execution)
    mvn smartgwt:install -Pisc -Dbuild.date=2013-01-01 -Doverwrite=true
    Example POM that builds the showcase
    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>com.isomorphic.smartgwt</groupId>
        <artifactId>showcase-enterprise</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>war</packaging>
    
        <properties>
            <gwt.version>2.5.0</gwt.version>
            <smartgwt.version>3.1-p20130105</smartgwt.version>
    
            <webapp.directory>${project.build.directory}/${project.build.finalName}</webapp.directory>
    
            <maven.compiler.source>1.6</maven.compiler.source>
            <maven.compiler.target>1.6</maven.compiler.target>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
    
        <dependencies> 
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>smartgwt-eval</artifactId> 
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>smartgwt-analytics</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>smartgwt-messaging</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-network</artifactId>
                <version>${smartgwt.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-sql</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-jpa</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-hibernate</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-spring</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.isomorphic.smartgwt</groupId>
                <artifactId>isomorphic-tools</artifactId>
                <version>${smartgwt.version}</version>
            </dependency>
    
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>3.1.1.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>3.1.1.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>4.2.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.6.1</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.6.1</version>
            </dependency>
            <dependency>
                <groupId>commons-dbcp</groupId> 
                <artifactId>commons-dbcp</artifactId>
                <version>1.4</version>
            </dependency>
            <dependency>
                <groupId>hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>1.8.0.10</version>
            </dependency>
            <dependency>
                <groupId>jstl</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
    
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.7</version>
                <scope>test</scope>
            </dependency>
    
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>${gwt.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-user</artifactId>
                <version>${gwt.version}</version>
                <scope>provided</scope>
            </dependency>
    
            <dependency>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-naming</artifactId>
                <version>6.1.12</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-plus</artifactId>
                <version>6.1.12</version>
                <scope>provided</scope>
            </dependency>
    
        </dependencies>
    
        <build>
            <pluginManagement>
                <plugins>
                    <!-- http://wiki.eclipse.org/M2E_plugin_execution_not_covered#execute_plugin_goal -->
                    <plugin>
                        <groupId>org.eclipse.m2e</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>1.0.0</version>
                        <configuration>
                            <lifecycleMappingMetadata>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.codehaus.mojo</groupId>
                                            <artifactId>gwt-maven-plugin</artifactId>
                                            <versionRange>[2.4.0,)</versionRange>
                                            <goals>
                                                <goal>i18n</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.apache.maven.plugins</groupId>
                                            <artifactId>maven-war-plugin</artifactId>
                                            <versionRange>[2.1.1,)</versionRange>
                                            <goals>
                                                <goal>exploded</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMappingMetadata>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>${gwt.version}</version>
                    <configuration>
                        <runTarget>index.html</runTarget>
                        <hostedWebapp>${webapp.directory}</hostedWebapp>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <webappDirectory>${webapp.directory}</webappDirectory>
                    </configuration>
                </plugin>
            </plugins>
    
        </build>
    
    </project>
    Please do give it a try on your own projects and reply here with your findings, including license, version, and any optional modules you might be using.


    Thanks in advance,

    Bill
    Last edited by bbruyn; 29 Aug 2013, 19:13. Reason: staging repo updated

    #2
    Great work! Will give it a try and I'll give you some feedback.

    Comment


      #3
      I guess I'll want to add another artifact for the modified java-engine.jar provided in the SDK for Java-based JSR223 datasource scriptlets. Forgot about that.

      Isomorphic, does it make sense to rename that JAR to include a version number, and perhaps an isc- prefix, for clarity/consistency's sake (e.g., see isc-jakarta-oro-2.0.6)? Doesn't seem to make much sense to version that one with every nightly build...

      By the way, you only need this for Java scripting, yes? Does it make sense to declare this as an optional dependency of isomorphic-core-rpc? I wouldn't try to include every available language, but I think it makes sense for this one...

      By the way, is this meant to work on java6 only?

      Comment


        #4
        java-engine.jar is no longer used. Java engine is now part of isomorphic_core_rpc.jar.

        Yes, this works only on java6, cause we are using Java Scripting API (since java6).

        Comment


          #5
          is there a switch to get 3.0p, running the install command appears to grab 3.1p by default

          Comment


            #6
            Yeah, that's apparently just the way Maven plugins work. It wants to run the latest version you have installed locally, or get latest from the remote repository the first time.

            To change that behavior, you have to qualify with the groupId and version number.

            Code:
            mvn com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:3.0:install
            My understanding is that you'll need the long form while it's still in staging. When it's released, you should be able to use the short form after the first time.

            Comment


              #7
              I tried that and I got this

              $ mvn com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:3.0:install
              [INFO] Scanning for projects...
              [WARNING]
              [WARNING] Some problems were encountered while building the effective model for com.isomorphic:smartgwt:pom:1.0.0
              [WARNING] The expression ${version} is deprecated. Please use ${project.version} instead.
              [WARNING]
              [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
              [WARNING]
              [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
              [WARNING]
              [INFO] ------------------------------------------------------------------------
              [INFO] Reactor Build Order:
              [INFO]
              [INFO] smartgwt
              [INFO] binary-distribution
              [INFO] isomorphic-core-rpc
              [INFO] isomorphic-sql
              [INFO] isomorphic-jpa
              [INFO] isomorphic-hibernate
              [INFO] isomorphic-spring
              [INFO] isomorphic-network
              [INFO] isomorphic-struts
              [INFO] isomorphic-tools
              [INFO] smartgwt-lgpl
              [INFO] smartgwt-skins
              [INFO] isomorphic-contentexport
              [WARNING] The POM for com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:jar:3.0 is missing, no dependency information available
              [INFO] ------------------------------------------------------------------------
              [INFO] Reactor Summary:
              [INFO]
              [INFO] smartgwt .......................................... SKIPPED
              [INFO] binary-distribution ............................... SKIPPED
              [INFO] isomorphic-core-rpc ............................... SKIPPED
              [INFO] isomorphic-sql .................................... SKIPPED
              [INFO] isomorphic-jpa .................................... SKIPPED
              [INFO] isomorphic-hibernate .............................. SKIPPED
              [INFO] isomorphic-spring ................................. SKIPPED
              [INFO] isomorphic-network ................................ SKIPPED
              [INFO] isomorphic-struts ................................. SKIPPED
              [INFO] isomorphic-tools .................................. SKIPPED
              [INFO] smartgwt-lgpl ..................................... SKIPPED
              [INFO] smartgwt-skins .................................... SKIPPED
              [INFO] isomorphic-contentexport .......................... SKIPPED
              [INFO] ------------------------------------------------------------------------
              [INFO] BUILD FAILURE
              [INFO] ------------------------------------------------------------------------
              [INFO] Total time: 0.744s
              [INFO] Finished at: Tue Jan 15 14:16:39 EST 2013
              [INFO] Final Memory: 5M/244M
              [INFO] ------------------------------------------------------------------------
              [ERROR] Plugin com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifac
              t descriptor for com.googlecode.smartgwt-maven-plugin:smartgwt-maven-plugin:jar:3.0: Failure to find com.googlecode.smartgwt-maven-plugin:smartgwt-mav
              en-plugin:pom:3.0 in http://salgs2cm01:8081/artifactory/plugins-release was cached in the local repository, resolution will not be reattempted until t
              he update interval of central has elapsed or updates are forced -> [Help 1]
              [ERROR]
              [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
              [ERROR] Re-run Maven using the -X switch to enable full debug logging.
              [ERROR]
              [ERROR] For more information about the errors and possible solutions, please read the following articles:
              [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

              Comment


                #8
                Looks like you're trying to resolve the plugin from Artifactory. I assume you'll need to set up a proxy to the Sonatype repo or disable whatever mirror you have set up that causes resolution from there (again, just until release).

                By the way, you should probably just run this from a directory without the old thing in it (any directory is fine).

                Comment


                  #9
                  I just realized that artifactory was likely needing help finding the repos.

                  Does this plugin fix the dependency issue that was present in the last project needing FileUpdate.jar?

                  Comment


                    #10
                    I assume you're referring to this?

                    The isomorphic-core-rpc artifact still declares commons-fileupload as optional, but I did find through testing that it's required by isomorphic-compression. It's been addressed there.

                    If you find that you still have some problem with it, please provide a stack trace. Meanwhile, I've let Isomorphic know about the omission in the official documentation.

                    Comment


                      #11
                      That particular omission is actually already addressed. Also, commons-fileupload is basically required by isomorphic_core_rpc even in the absence of compression (there are a few more cases where it would be called).

                      Comment


                        #12
                        Originally posted by Isomorphic View Post
                        Also, commons-fileupload is basically required by isomorphic_core_rpc even in the absence of compression (there are a few more cases where it would be called).
                        Going how far back? Is that new to 4.0d?

                        Comment


                          #13
                          It's not something new to 4.0d. We haven't tried to look at how far back it goes as commons-upload is a very stable and common library.

                          Comment


                            #14
                            I will let you know if I have any issues using it in our project as soon as I manage to get 3.0 working for me.

                            Comment


                              #15
                              Originally posted by Isomorphic View Post
                              It's not something new to 4.0d. We haven't tried to look at how far back it goes as commons-upload is a very stable and common library.
                              Well, sure... But what I meant was, do you believe that it should have been listed as required in the doc for 2.5 through 3.1? The documentation present in today's 3.1 power download still lists it as optional, though I can see that it's listed as required here.

                              Comment

                              Working...
                              X