Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.3.6
-
Component/s: Project infrastructure
-
Labels:None
-
Environment:Windows 7 64-bit
Maven 2.2.1
-
Patch Submitted:Yes
Description
The AbstractGrailsMojo throws a NPE when attempting to check the scope of a dependency when running the maven-functional-test mojo of the Grails Maven plugin. This occurs when there are dependencies present in the POM file that do not have scopes defined (i.e. have the default "compile" scope). It appears that Maven does not assign a scope to these dependencies when only running the functional test goal (i.e. mvn grails:maven-functional-test). This causes the .equals("system") call to throw an NPE:
FunctionalSpec-test mvn-functional-test-22-grails_maven-functional-test_-DgrailsVersion=1.3.6
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.grails:test-application:grails-app:1.0-SNAPSHOT
[INFO] task-segment: [grails:maven-functional-test]
[INFO] ------------------------------------------------------------------------
[INFO] [grails:maven-functional-test
]
[INFO] Using Grails 1.3.6
java.lang.NullPointerException
at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:209)
at org.grails.maven.plugin.MvnFunctionalTestMojo.execute(MvnFunctionalTestMojo.java:61)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Running pre-compiled script
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to start Grails
Attached is a patch that fixes the issue by checking the scope to make sure it is not null before attempting to perform the equals comparison.
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Fixed: https://github.com/grails/grails-maven/commit/744f09a1da0658108a7ac7c3970028f926316989