IncompatibleClassChangeError: class ClassMetadataReadingVisitor has interface ClassVisitor as super class

This error happens when the loaded class i.e. ClassMetadataReadingVisitor does not respect the contract of inherited abstract class or interface i.e. ClassVisitor. Looks like at load time different versions of the above classes are getting loaded in your case. Seems you have new spring-core jar and old spring-asm jar in your application. ClassMetadataReadingVisitor class is … Read more

How can I write maven build to add resources to classpath?

A cleaner alternative of putting your config file into a subfolder of src/main/resources would be to enhance your classpath locations. This is extremely easy to do with Maven. For instance, place your property file in a new folder src/main/config, and add the following to your pom: <build> <resources> <resource> <directory>src/main/config</directory> </resource> </resources> </build> From now, … Read more

How to exclude maven dependencies?

You can utilize the dependency management mechanism. If you create entries in the <dependencyManagement> section of your pom for spring-security-web and spring-web with the desired 3.1.0 version set the managed version of the artifact will override those specified in the transitive dependency tree. I’m not sure if that really saves you any code, but it … Read more

Maven 3 – Worth it? [closed]

What’s new in Maven 3? Here is a little compilation of what you can find around the net. Backward compatibility – Maven 3 is backward compatible, that is extremely important (especially for those who experienced the Maven 1 to Maven 2 transition). Versionless parent elements – Maven 3 will remove the need to specify the … Read more

How do you stop maven from trying to access http://repo.maven.apache.org?

All pom files inherit from the maven super POM http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html which contains this entry: <repositories> <repository> <id>central</id> <name>Central Repository</name> <url>http://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> Try setting this in your pom (with <id>central</id>): <repositories> <repository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories>

Maven error: Not authorized, ReasonPhrase:Unauthorized

The issue may happen while fetching dependencies from a remote repository. In my case, the repository did not need any authentication and it has been resolved by removing the servers section in the settings.xml file: <servers> <server> <id>SomeRepo</id> <username>SomeUN</username> <password>SomePW</password> </server> </servers> ps: I guess your target is mvn clean install instead of maven install … Read more

Maven managed dependencies – resolving ${project.version} from parent pom

You have to skip <version> tag in child, but keep the <parent><version> … </parent> tag. http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance One factor to note is that these variables are processed after inheritance as outlined above. This means that if a parent project uses a variable, then its definition in the child, not the parent, will be the one eventually … Read more