[antlr-interest] ANTLR building and Maven 2
Eric Webb
eric at collectivegenius.net
Tue Feb 16 20:58:08 PST 2010
I think there is a bug (or change in behavior) in the latest version of
buildnumber-maven-plugin. I was able to get things compiling if I
manually downgraded the version by adding the below to the pom.xml files
in the <plugins> tag.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<configuration>
<format>{0,number}</format>
<items>
<item>buildNumber0</item>
</items>
</configuration>
<executions>
<execution>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
I personally added the above in pom.xml, runtime/Java/pom.xml, and
tool/pom.xml.
I am not sure about the actual fix, but this got things to working
enough for me.
cheers,
eric
On 02/16/2010 08:34 PM, Michael Richter wrote:
> I think I'm being as thick as a whale sandwich here, but I can't get ANTLR
> to work nicely with Maven 2 at all. The instructions for this in a variety
> of places are ... inconsistent and in most cases also not terribly well
> written. Not having any way to generate a functioning skeleton (that I can
> see) doesn't help much.
>
> I had the brilliant idea of using the ANTLR build process itself to solve
> the problem by looking at a known-good pom.xml file that does the trick.
> That's when I got hit by this:
>
> michael at isolde:~/Development/antlr-3.2$ mvn
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO] ANTLR Master build control POM
> [INFO] Antlr 3 Runtime
> [INFO] ANTLR Grammar Tool
> [INFO] Maven plugin for ANTLR V3
> [INFO] ANTLR gUnit
> [INFO] Maven plugin for gUnit ANTLR V3
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building ANTLR Master build control POM
> [INFO] task-segment: [install]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [buildnumber:create {execution: default}]
> [INFO] Storing buildNumber: Feb 17, 2010 12:28:04 at timestamp:
> 1266380884520
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] The scm url cannot be null.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException: The scm url cannot be null.
> at
> org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(AbstractScmManager.java:181)
> at
> org.codehaus.mojo.build.CreateMojo.getScmRepository(CreateMojo.java:722)
> at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:593)
> at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:452)
> 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.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> 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)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Wed Feb 17 12:28:04 CST 2010
> [INFO] Final Memory: 15M/176M
> [INFO]
> ------------------------------------------------------------------------
>
> This bothers me a bit, not being able to build the package from the provided
> source. What bothers me even more is the reference to the "scm URL". A
> quick grep of the pom.xml files finds one of them (runtime/Java/pom.xml)
> that has an<scm>...</scm> tag -- and it's not empty.
>
> I'm now at a complete loss for how to progress. I can't use Maven on the
> project I'm working on because I don't know how to get it working and I
> can't find out how to make it work by looking at ANTLR's source because the
> build is broken for me. What's the next step?
>
>
More information about the antlr-interest
mailing list