I'm getting the following error when I do
mvn clean deploy -DperformRelease=true
[ERROR] Exit code: 1 - .java:3: package javax.inject does not exist
[ERROR] import javax.inject.Named;
[ERROR] ^
[ERROR] TransactionServiceExternalImpl.java:5: cannot find symbol
[ERROR] symbol: class Named
[ERROR] @Named("transactionServiceExternal")
[ERROR] ^
[ERROR] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
The POM is this...
<groupId>com.xxx</groupId>
<artifactId>ts-impl/artifactId>
<version>2.4.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
</dependencies>
There is only one class...
import javax.inject.Named;
@Named("transactionServiceExternal")
public class TransactionServiceExternalImpl
{
}
I get the error with
- jdk1.5.0_22
- jdk1.6.0_29
- jdk1.6.0_43
- jdk1.6.0_43_32bit
But NOT with...
- jdk1.7.0_05
Anyone have any ideas?
Notes: Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
I now know that the reason is that the Maven Javadoc Plugin has changed from 2.9.1 to 2.10. and this is the cause of the problem.
I can see this warning...
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing.
By setting the following in my pom....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
I can fix the version back to the last release.
I will raise a bug with the Maven Javadoc creators.
http://jira.codehaus.org/browse/MJAVADOC-407
On a side note: you can clone the SVN repo for version 2.9.1, update the pom to 2.10.1, do a mvn install to put it in you M2 folder. You should be up and working again, you just need to remove this tmp version when the real release comes out.