Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Working with Mavenized Grails projects in GGTS 3.1.0 *Updated for 3.1.0 release*

  1. #11

    Default Enabling Grails Dependency Management

    I'm confused about how to enable Grails dependency management 'manually'.

    When importing the project as an existing maven project, I am asked if I want to convert the project to a Grails project. Am I supposed to select 'No to all'? I selected 'No' because the instructions posted said nothing about this dialog and how one should respond to it.

    After importing the project, I couldn't find anything about how to enable Grails dependency. Am I supposed to right click on the project and select 'Convert to grails project'? I did that and the project is then converted. However, when I expand the classpath item, I only see Grails dependencies, not both Maven and Grails. The Maven item is still on the context menu when I right click on my project though.
    Last edited by selenareneephillips; Oct 4th, 2012 at 10:27 AM.

  2. #12
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    I just did a complete refresh of the instructions for the 3.1.0 release out next week (you can also update to a nightly snapshot to get it now). I would recommend that you update and try again using the new instructions. Should be much more straight forward now.

    Let me know if this helps anything.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  3. #13

    Default That worked

    That worked.

    I am getting this warning:

    Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment.

    I added the maven-compiler-plugin to my pom and specified the source and target to be java 1.7. I have installed the oracle java 7 JDK and added it as an execution environment in my Java Preferences. So, I don't understand how or why m2e is setting the execution environment to Java 1.6 for my project.
    Last edited by selenareneephillips; Oct 4th, 2012 at 06:53 PM.

  4. #14
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    Have a look at Project -> Properties -> Java Build Path -> Libraries. Your JRE System Library, what level is it at? I'm guessing that this is where the incompatible execution environment is coming from.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  5. #15

    Default

    It has Java SE 1.6. However, in my pom.xml I have specified this for the maven-compiler plugin:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.5.1</version>
    <configuration>
    <source>1.7</source>
    <target>1.7</target>
    </configuration>
    </plugin>

    This should tell maven to use java 1.7. I have installed oracle java 7 and configured GGTS Preferences>Intalled JREs to point at that. Yet, somehow, m2eclipse always sets the project properties to Java SE 1.6 after I run Maven>Update Project. I don't know where it is getting this setting. Nothing in my pom or anything in GGTS is telling it to use 1.6.

  6. #16

    Default

    It has Java SE 1.6. However, in my pom.xml I have specified this for the maven-compiler plugin:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.5.1</version>
    <configuration>
    <source>1.7</source>
    <target>1.7</target>
    </configuration>
    </plugin>

    This should tell maven to use java 1.7. I have installed oracle java 7 and configured GGTS Preferences>Intalled JREs to point at that. Yet, somehow, m2eclipse always sets the project properties to Java SE 1.6 after I run Maven>Update Project. I don't know where it is getting this setting. Nothing in my pom or anything in GGTS is telling it to use 1.6.

  7. #17
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    The grails-maven configurator tries to get the java level from the maven-compiler-plugin. If it can't find it, then it just defaults to 1.6. I'm guessing that for some reason the configurator is not finding your snippet. This might be a bug in the grails-maven configurator. I'll take a look.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  8. #18
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    Definitely a bug on our side. I don't think it will be able to make it into GGTS 3.1.0, however. It will be in a nightly build shortly after the release. I raised this issue: https://issuetracker.springsource.com/browse/STS-2958

    Please keep track of progress there.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  9. #19

    Default

    I am also getting these two other warnings --

    The resource is a duplicate of .link_to_grails_plugins/hibernate-2.1.1/grails-app/i18n/messages.properties and was not copied to the output folder messages.properties /versantium/.link_to_grails_plugins/jquery-1.8.0/grails-app/i18n

    The resource is a duplicate of .link_to_grails_plugins/hibernate-2.1.1/grails-app/i18n/messages.properties and was not copied to the output folder messages.properties /versantium/.link_to_grails_plugins/resources-1.1.6/grails-app/i18n

    This is a completely empty grails project. I just did create-app and create-pom on the command line and them imported it as a maven project into GGTS.

  10. #20
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    This is unrelated to maven and is a has to do with how Eclipse manages Grails classpaths. Because grails plugins may each have their own i18n folders and files, but placed in the same package and with the same name as other plugins, this can cause conflicts due to duplicated resources. This will not affect the built war files since the grails build process packages things up properly.

    Other than the warnings, are you seeing any odd behavior?
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

Tags for this Thread

Posting Permissions

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