tags:

views:

26

answers:

1

I have a Maven module called display. It is part of a larger reactor chain, and I have added code into a file called SomeClass.java within display which references java.text.ParseException, which is imported without a problem. My code in Eclipse shows no reference or import problems and compiles without a problem. However, when I run mvn clean install from the command-line in the parent directory, suddenly display is throwing an error as follows:

Compiling module xxx.yyy.display
    Validating newly compiled units
        [ERROR] Errors in 'file://path/to/SomeClass.java'
            [ERROR] Line 3: The import java.text cannot be resolved
            [ERROR] Line x: ParseException cannot be resolved to a type
            ...

The second line repeats for every reference to ParseException. This makes little sense because other modules with references to java.text.ParseException compile without problem. I decided to install only this module, so I changed into the display directory, and ran mvn clean install on just this module. It failed with the same message. I then ran mvn clean compile, and it worked.

I deleted the SNAPSHOT war from my repository and tried again, and it still failed with the same message. I am wondering why compiling works fine but installing fails during compilation. Help is appreciated.

+1  A: 

"Answering" this for anyone who is curious -- the reason was because Google Web Toolkit doesn't support all of the standard Java classes but doesn't provide any message to that effect. Moving the reference to java.text.ParseException from a file in the client package to one in the server package allowed everything to compile correctly.

Andy