Grails Maven Plugin

mvn grails:run-app not working yet?

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  1. pom-no-domain-class.xml
    15/Dec/08 8:35 AM
    3 kB
    George Stathis
  2. pom-original.xml
    15/Dec/08 8:35 AM
    3 kB
    George Stathis

Activity

Hide
George Stathis added a comment -

Tested in both OS X 10.5.5 and Win XP Pro. Steps to reproduce:

  • Use grails-maven-archetype to create new project
  • CD into new project
  • mvn grails:create-domain-class Foo
  • mvn grails:generate-all
  • mvn clean package
  • mvn grails:run

Jetty is running but is unaware of the project context.

Show
George Stathis added a comment - Tested in both OS X 10.5.5 and Win XP Pro. Steps to reproduce:
  • Use grails-maven-archetype to create new project
  • CD into new project
  • mvn grails:create-domain-class Foo
  • mvn grails:generate-all
  • mvn clean package
  • mvn grails:run
Jetty is running but is unaware of the project context.
Hide
Peter Ledbrook added a comment -

Any errors? What version of Grails does your POM reference? What do you mean that Jetty is unaware of the project context? Actually, grails:generate-all doesn't seem to be working at the moment, so I guess you're using 1.1-beta1?

Show
Peter Ledbrook added a comment - Any errors? What version of Grails does your POM reference? What do you mean that Jetty is unaware of the project context? Actually, grails:generate-all doesn't seem to be working at the moment, so I guess you're using 1.1-beta1?
Hide
Peter Ledbrook added a comment -

If you are using Grails 1.1-SNAPSHOT artifacts, try this in your project POM:

<dependency>
      <groupId>opensymphony</groupId>
      <artifactId>oscache</artifactId>
      <version>2.4</version>
      <exclusions>
        <exclusion>
          <groupId>javax.jms</groupId>
          <artifactId>jms</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>1.8.0.5</version>
    </dependency>

I'll be adding this to the archetype later.

Show
Peter Ledbrook added a comment - If you are using Grails 1.1-SNAPSHOT artifacts, try this in your project POM:
<dependency>
      <groupId>opensymphony</groupId>
      <artifactId>oscache</artifactId>
      <version>2.4</version>
      <exclusions>
        <exclusion>
          <groupId>javax.jms</groupId>
          <artifactId>jms</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>1.8.0.5</version>
    </dependency>
I'll be adding this to the archetype later.
Hide
George Stathis added a comment -

My apologies for not providing enough information. I am attaching my pom at the time I posted this ticket (pom-original.xml).

The project was generated using the archetype instructions here: http://www.grails.org/Maven+Integration

It seems that the version was 1.1-SNAPSHOT according to the pom. I don't see 1.1-beta1 mentioned anywhere in the pom. Should I be looking elsewhere?

What I meant by jetty being unaware of the project context was that I was getting an HTTP 503 when I navigated to the app after running 'mvn grails:run-app'. That is, Jetty was running by did not recognize my app as deployed.

I added the dependencies that you posted and the app now does indeed deploy. I see the Grails Welcome screen when I start Jetty.

Unfortunately, some changes seem to have been made to the archetype since the last time I posted. I created a new app today (see next attached pom, pom-no-domain-class.xml). The 'mvn grails:create-domain-class' call fails with the following:

GPSs-MacBook-Pro:gps-test gstathis$ mvn grails:create-domain-class
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.gps:gps-test:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:create-domain-class] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[WARNING] Attempting to build MavenProject instance for Artifact (org.grails:grails-maven-plugin:0.4-20081212.162203-7) of type: maven-plugin; constructing POM artifact instead.
[INFO] [grails:create-domain-class]
Running pre-compiled script
Environment set to development
null name not specified. Please enter:
Foo
Unable to load script 'CreateDomainClass' (error: java.io.FileNotFoundException: class path resource [src/grails/templates/artifacts/null.groovy] cannot be opened because it does not exist)
Run 'grails help' for a complete list of available scripts.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Grails returned non-zero value.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Mon Dec 15 09:21:33 EST 2008
[INFO] Final Memory: 20M/1016M
[INFO] ------------------------------------------------------------------------

Notice the path src/grails/templates/artifacts/null.groovy

I can create a new issue in Jira for this one if it helps you track it better. The Jetty issue is resolved, as log as the artifact contains the dependencies you mentioned. Hope this helps.

Best Regards.

Show
George Stathis added a comment - My apologies for not providing enough information. I am attaching my pom at the time I posted this ticket (pom-original.xml). The project was generated using the archetype instructions here: http://www.grails.org/Maven+Integration It seems that the version was 1.1-SNAPSHOT according to the pom. I don't see 1.1-beta1 mentioned anywhere in the pom. Should I be looking elsewhere? What I meant by jetty being unaware of the project context was that I was getting an HTTP 503 when I navigated to the app after running 'mvn grails:run-app'. That is, Jetty was running by did not recognize my app as deployed. I added the dependencies that you posted and the app now does indeed deploy. I see the Grails Welcome screen when I start Jetty. Unfortunately, some changes seem to have been made to the archetype since the last time I posted. I created a new app today (see next attached pom, pom-no-domain-class.xml). The 'mvn grails:create-domain-class' call fails with the following: GPSs-MacBook-Pro:gps-test gstathis$ mvn grails:create-domain-class [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'grails'. [INFO] ------------------------------------------------------------------------ [INFO] Building Unnamed - org.gps:gps-test:war:1.0-SNAPSHOT [INFO] task-segment: [grails:create-domain-class] (aggregator-style) [INFO] ------------------------------------------------------------------------ [WARNING] Attempting to build MavenProject instance for Artifact (org.grails:grails-maven-plugin:0.4-20081212.162203-7) of type: maven-plugin; constructing POM artifact instead. [INFO] [grails:create-domain-class] Running pre-compiled script Environment set to development null name not specified. Please enter: Foo Unable to load script 'CreateDomainClass' (error: java.io.FileNotFoundException: class path resource [src/grails/templates/artifacts/null.groovy] cannot be opened because it does not exist) Run 'grails help' for a complete list of available scripts. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Grails returned non-zero value. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9 seconds [INFO] Finished at: Mon Dec 15 09:21:33 EST 2008 [INFO] Final Memory: 20M/1016M [INFO] ------------------------------------------------------------------------ Notice the path src/grails/templates/artifacts/null.groovy I can create a new issue in Jira for this one if it helps you track it better. The Jetty issue is resolved, as log as the artifact contains the dependencies you mentioned. Hope this helps. Best Regards.
Hide
Peter Ledbrook added a comment -

Thanks for testing this. Don't bother raising a separate issue - it's a breakage introduced with the latest version of Gant. The Grails tests were failing, so I just need to fix the appropriate scripts. Once that's done, I can upload new Grails artifacts and it should (fingers crossed) work fine.

I still have to update the archetype POM too.

Show
Peter Ledbrook added a comment - Thanks for testing this. Don't bother raising a separate issue - it's a breakage introduced with the latest version of Gant. The Grails tests were failing, so I just need to fix the appropriate scripts. Once that's done, I can upload new Grails artifacts and it should (fingers crossed) work fine. I still have to update the archetype POM too.
Hide
George Stathis added a comment -

Don't mention it. I'm just looking forward to using this. Let me know when the Gant scripts and archetype are fixed if you want me to test again. I can then mark this ticket as officially resolved.

Show
George Stathis added a comment - Don't mention it. I'm just looking forward to using this. Let me know when the Gant scripts and archetype are fixed if you want me to test again. I can then mark this ticket as officially resolved.
Hide
Peter Ledbrook added a comment -

Done. New versions of all three components have been uploaded: the Grails artifacts, the plugin, and the archetype.

Show
Peter Ledbrook added a comment - Done. New versions of all three components have been uploaded: the Grails artifacts, the plugin, and the archetype.
Hide
George Stathis added a comment -

Confirmed. Cleaned local repository and got the latest artifacts. 'mvn grails:create-domain-class' works and 'mvn grails:run-app' deploys the app.

Show
George Stathis added a comment - Confirmed. Cleaned local repository and got the latest artifacts. 'mvn grails:create-domain-class' works and 'mvn grails:run-app' deploys the app.
Hide
Peter Ledbrook added a comment -

George confirmed fix works.

Show
Peter Ledbrook added a comment - George confirmed fix works.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: