jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Plugin Tools
  • MPLUGIN-1

Maven fails while developing plugin with 1.5 compliant sources

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.2
  • Component/s: None
  • Labels:
    None

Description

I'm developing a plugin for Maven, and my sources contains 1.5 features, such as use of generics. When I try to install the plugin in my local repository I get the following:

[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Docbook plugin
[INFO] task-segment: [install]
[INFO] ----------------------------------------------------------------------------
[INFO] [plugin:descriptor]
[INFO] ----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] syntax error @[129,64] in file:/C:/Documents and Settings/jgonzalez/Mis documentos/proyectos/otros/maven-opendocbook-plugin/src/
main/java/com/openinput/tools/maven/opendocbook/TransformMojo.java
[INFO] ----------------------------------------------------------------------------
[INFO] Trace
com.thoughtworks.qdox.parser.ParseException: syntax error @[129,64] in file:/C:/Documents and Settings/jgonzalez/Mis documentos/proyectos/otros/maven-opendocbook-plugin/src/main/java/com/openinput/tools/maven/opendocbook/TransformMojo.java
at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:504)
at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:610)
at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:488)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:296)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:308)
at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:365)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:362)
at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.execute(JavaMojoDescriptorExtractor.java:477)
at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:69)
at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:99)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:399)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
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:585)
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: 5 seconds
[INFO] Finished at: Tue Nov 22 09:54:13 CET 2005
[INFO] Final Memory: 4M/7M
[INFO] ----------------------------------------------------------------------------

The line causing the error contains the following:

private static class FilePathComparator implements Comparator<String>

So the problem seems to be caused by qdox not being able to parse 1.5 sources.

Issue Links

is depended upon by

Improvement - An improvement or enhancement to an existing feature or task. MPLUGIN-15 Support includes/excludes

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.
is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MPLUGIN-21 Use of Java 5 annotations in Mojos produce error in QDox Parser

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Improvement - An improvement or enhancement to an existing feature or task. QDOX-94 Full Support for Processing Java 5 source

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Gilles Scokart added a comment - 09/Dec/05 4:49 AM

It doesn't suport neither annotations like @overwrite.

Show
Gilles Scokart added a comment - 09/Dec/05 4:49 AM It doesn't suport neither annotations like @overwrite.
Hide
Permalink
Carlos Sanchez added a comment - 04/Jan/06 9:52 AM

The problem is that QDOX doesn't support it

Show
Carlos Sanchez added a comment - 04/Jan/06 9:52 AM The problem is that QDOX doesn't support it
Hide
Permalink
Jurgen De Landsheer added a comment - 28/Jun/06 8:53 AM

qdox doesn't support any annotation

another problem is generic maps Map<String,String> for example breaks during jar creation/installation of a plugin by any other collection does not

would really like to see this resolved, thx

Show
Jurgen De Landsheer added a comment - 28/Jun/06 8:53 AM qdox doesn't support any annotation another problem is generic maps Map<String,String> for example breaks during jar creation/installation of a plugin by any other collection does not would really like to see this resolved, thx
Hide
Permalink
Jimisola Laursen added a comment - 12/Jul/06 11:24 AM

There doesn't seem to be any activity around this issue. The use of Java 1.5 functionality is being more and more common nowadays. This improvement/bug fix is therefore becoming more and more important. Because of this issue I can't reuse code since most other source I write is in Java 1.5.

Found mvn-anno-mojo (http://sourceforge.net/projects/mvn-anno-mojo) btw: "Maven 2 build system extention that allows writing annotatd Mojos using JDK 1.5 annotations instead of doclet comments.": It uses APT and QDox-1.6-SNAPSHOT

Show
Jimisola Laursen added a comment - 12/Jul/06 11:24 AM There doesn't seem to be any activity around this issue. The use of Java 1.5 functionality is being more and more common nowadays. This improvement/bug fix is therefore becoming more and more important. Because of this issue I can't reuse code since most other source I write is in Java 1.5. Found mvn-anno-mojo (http://sourceforge.net/projects/mvn-anno-mojo) btw: "Maven 2 build system extention that allows writing annotatd Mojos using JDK 1.5 annotations instead of doclet comments.": It uses APT and QDox-1.6-SNAPSHOT
Hide
Permalink
Jimisola Laursen added a comment - 13/Jul/06 3:49 PM

If QDox's non-support of JDK 1.5 (and annotations) is a show-stopper wouldn't it be possible to allow both JavaDoc annotations (for 1.4.x) and Java Annotations (for 1.5+)?
This is how TestNG does - if I am not mistaking. I believe that there are several benefits by allowing developers to use real Java annotations:

  • type-safety
  • easier to know what values are allowed

The Descriptor Maven Plugin (plugin:descriptor) will be able to use APT (http://java.sun.com/j2se/1.5.0/docs/guide/apt/).
Don't know how far the Maven Annotated Mojo (http://sourceforge.net/projects/mvn-anno-mojo) has come, but it might be possible to use their code since it is licensed used APL 2.0.

Show
Jimisola Laursen added a comment - 13/Jul/06 3:49 PM If QDox's non-support of JDK 1.5 (and annotations) is a show-stopper wouldn't it be possible to allow both JavaDoc annotations (for 1.4.x) and Java Annotations (for 1.5+)? This is how TestNG does - if I am not mistaking. I believe that there are several benefits by allowing developers to use real Java annotations:
  • type-safety
  • easier to know what values are allowed
The Descriptor Maven Plugin (plugin:descriptor) will be able to use APT (http://java.sun.com/j2se/1.5.0/docs/guide/apt/). Don't know how far the Maven Annotated Mojo (http://sourceforge.net/projects/mvn-anno-mojo) has come, but it might be possible to use their code since it is licensed used APL 2.0.
Hide
Permalink
Matthew Pocock added a comment - 11/Sep/06 11:42 AM

This is really annoying for us. Apparently qdox 1.6 is out, and handles java5 syntax gracefully.

http://joe.truemesh.com/blog//000642.html

I have hacked maven-plugin-tools-java-2.0.1.pom to refer to qdox v 1.6, and now everything runs fine for me. Could someone who knows check if this does solve the problem in general, and make the change? Pretty please?

Show
Matthew Pocock added a comment - 11/Sep/06 11:42 AM This is really annoying for us. Apparently qdox 1.6 is out, and handles java5 syntax gracefully. http://joe.truemesh.com/blog//000642.html I have hacked maven-plugin-tools-java-2.0.1.pom to refer to qdox v 1.6, and now everything runs fine for me. Could someone who knows check if this does solve the problem in general, and make the change? Pretty please?
Hide
Permalink
Jimisola Laursen added a comment - 11/Sep/06 12:19 PM

QDox 1.6. That is really good news. I wonder why QDOX-94 haven't been resolved...

What are the requirements for Maven in general 1.4 or even 1.3?
Don't think that Apache and Codehaus plugins should require 1.5, but I would like to be able touse 1.5 for "internal" plugins.

Show
Jimisola Laursen added a comment - 11/Sep/06 12:19 PM QDox 1.6. That is really good news. I wonder why QDOX-94 haven't been resolved... What are the requirements for Maven in general 1.4 or even 1.3? Don't think that Apache and Codehaus plugins should require 1.5, but I would like to be able touse 1.5 for "internal" plugins.
Hide
Permalink
Albert Strasheim added a comment - 18/Dec/06 6:28 AM

The workaround I came up with was to but my Java 5 annotation containing code into a separate jar and make a project containing only my mojo which depends on this jar.

Show
Albert Strasheim added a comment - 18/Dec/06 6:28 AM The workaround I came up with was to but my Java 5 annotation containing code into a separate jar and make a project containing only my mojo which depends on this jar.

People

  • Assignee:
    Brett Porter
    Reporter:
    Jose Gonzalez Gomez
Vote (19)
Watch (12)

Dates

  • Created:
    22/Nov/05 3:02 AM
    Updated:
    22/Dec/06 9:02 PM
    Resolved:
    22/Dec/06 9:02 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.