wildfly 10: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

I just made all hibernate dependencies provided scope and problem solved! <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.1.0.Final</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>5.2.4.Final</version> <scope>provided</scope> </dependency> <!– for JPA, use hibernate-entitymanager instead of hibernate-core –> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>5.1.0.Final</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> <version>5.1.0.Final</version> <scope>provided</scope> </dependency>

How to get access to Maven’s dependency hierarchy within a plugin

The dependency plugin has the tree goal that does most of this work. It processes a MavenProject using the DependencyTreeBuilder, this returns a DependencyNode with hierarchical information about the resolved dependencies (and their transitive dependencies). You can copy much of the code directly from the TreeMojo. It uses the CollectingDependencyNodeVisitor to traverse the tree and … Read more

Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

Your debug output indicates that Clean is the first thing that it’s trying to run, so I’m guessing it’s failing to download any plugins from central. First off, see if you can download the plugin jar directly in a web browser: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar If that works then your web browser has connectivity to central but maven … Read more

In Maven how to exclude resources from the generated jar?

To exclude any file from a jar / target directory you can use the <excludes> tag in your pom.xml file. In the next example, all files with .properties extension will not be included: <build> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>*.properties</exclude> </excludes> <filtering>false</filtering> </resource> </resources> </build>

How does maven sort version numbers?

Since version 3.0, Maven uses a consistent system to compare version numbers for both individual versions and version ranges. The system now makes a lot of sense, once you’ve understood a few gotchas. All comparisons are now done by ComparableVersion, which says: mixing of ‘-‘ (dash) and ‘.‘ (dot) separators, transition between characters and digits … Read more

How to generate classes from wsdl using Maven and wsimport?

To generate classes from WSDL, all you need is build-helper-maven-plugin and jaxws-maven-plugin in your pom.xml Make sure you have placed wsdl under folder src/main/resources/wsdl and corresponding schema in src/main/resources/schema, run command “mvn generate-sources” from Project root directory. C:/Project root directory > mvn generate-sources generated java classes can be located under folder target/generated/src/main/java/com/raps/code/generate/ws. pom.xml snippet <plugin> … Read more