Announcement

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

    Maven+SmartGWT+Eclipse

    Hi,
    can someone give me some hints how to create a Maven project using the tools specified in post's title. I am in a blocking point. Thank you

    #2
    You can use an archetype to generate your first GWT project, then you add Smart GWT stuff to it. Here's the explanation of how to use the archetype:

    http://mojo.codehaus.org/gwt-maven-p...archetype.html

    Although I have several SmartGWT applications, I've just followed the directions to create a new one, so here are the results. I typed in:
    Code:
    mvn archetype:generate  -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.6.0-rc1
    I got an interactive set of questions and I filled them out like this:
    Code:
    Define value for property 'groupId': : sample.my
    Define value for property 'artifactId': : sgwtexample
    Define value for property 'version':  1.0-SNAPSHOT: :
    Define value for property 'package':  sample.my: :
    Define value for property 'module': :
    [WARNING] Archetype is not fully configured
    [INFO] Using property: groupId = sample.my
    [INFO] Using property: artifactId = sgwtexample
    [INFO] Using property: version = 1.0-SNAPSHOT
    [INFO] Using property: package = sample.my
    Define value for property 'module': : sample.my.sgwtexample.Example
    Confirm properties configuration:
    groupId: sample.my
    artifactId: sgwtexample
    version: 1.0-SNAPSHOT
    package: sample.my
    module: sample.my.sgwtexample.Example
     Y: : y
    It created a project along with all of the necessary Eclipse files. I imported the existing project into Eclipse. You can then add the lines in the gwt.xml file to include SmartGWT and of course, modify the pom file to add the smartgwt dependencies.

    Comment


      #3
      Thank you for the quick reply
      Following error appears when trying to add a button from smartgwt :
      java.lang.UnsupportedClassVersionError: com/google/gwt/core/client/JavaScriptObject$ : Unsupported major.minor version 51.0

      Any help is appreciated

      Comment


        #4
        Can you put what version of things you're using? Like SmartGWT, GWT, JDK?

        When I generated the project from the archetype, I had to go in an change the GWT SDK version and the JDK version. Even though my eclipse is set to use JDK 1.7, the archetype chose 1.5. And even though my default GWT SDK is set to 2.5.0, the configuration in the project is "unknown version"

        For the JDK, I modified the pom file to specify 1.7 in the maven-compiler-plugin

        For the GWT SDK, I modified the eclipse project configuration. Right-click on the project, choose Properties. Then Google->Web Toolkit and set up your SDK.

        Comment


          #5
          One of the problems is that, if you followed my example, the module name isn't right. It should just be the final part of the module name, not with the full path included because final module name is a concatenation of the different components that you specified. I'm not used to generating the projects, so it's a surprise to me too.

          So I re-created a project this time like this:
          Code:
          [INFO] Generating project in Interactive mode
          [INFO] Archetype repository missing. Using the one from [org.codehaus.mojo:gwt-m
          aven-plugin:2.5.1] found in catalog remote
          Define value for property 'groupId': : tmp.myproject
          Define value for property 'artifactId': : sample
          Define value for property 'version':  1.0-SNAPSHOT: :
          Define value for property 'package':  tmp.myproject: :
          Define value for property 'module': : SampleModule
          Confirm properties configuration:
          groupId: tmp.myproject
          artifactId: sample
          version: 1.0-SNAPSHOT
          package: tmp.myproject
          module: SampleModule
           Y: : y
          And I just noticed that the archetype page says to use GWT 2.6.0-rc1, but we've been using GWT 2.5.0 with SmartGWT 4.0, so maybe you want to change that on the command line, or change it in your pom.
          Last edited by kimmie; 29 Nov 2013, 05:52.

          Comment


            #6
            Thank you,
            the problem was the following: I was compiling from Eclipse using jdk 1.6 and at Runtime I was using jdk 1.7. Problem was solved now. Thanks again for your help. I will recreate the project as you mentioned.

            Comment


              #7
              I'm back with some other question. If I want to use the latest build for smartgwt for instance the one which was build last night, can you please tell me what is the dependency wich I need in Maven? What about the repository?
              Thank you

              Comment

              Working...
              X