Maven Duplicate Class Compilation Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta maven find duplicate classes Discuss the workings and policies of this site About Us Learn more
Maven Ignore Duplicate Classes
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Duplicate Class Error In Ant Build
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you,
Maven Duplicate Class Warning
helping each other. Join them; it only takes a minute: Sign up maven compilation error: duplicate classes up vote 8 down vote favorite 3 In my maven2 project I have a directory ${basedir}/autogen that contains some autogenerated source code files produced by wsdl2java. When running mvn compile I get an compilation error, because of duplicate classes, that lives maven remove duplicate dependencies in ${basedir}/autogen. This is true. But what is the compilation phase doing in ${basedir}/autogen? I have not told maven to add this directory as a source directory. And there seems to be no way of telling maven to ignore the directory. maven-2 maven-plugin share|improve this question edited Jul 30 '09 at 21:34 Rich Seller 61.2k16143161 asked May 19 '09 at 11:57 vpalle 2601613 @vpalle can you list the duplicated class names? are they dupes of javax.* classes? –sal May 26 '09 at 14:24 I am having a similar issue I need to digest a wsdl web service and a schema xsd. Neither has all I need, but in the overlap there are dups which then throw duplicat class errors on compile. –Adam Jun 23 '10 at 17:30 add a comment| 6 Answers 6 active oldest votes up vote 16 down vote I had the same problem when using the maven-processor-plugin and found that the solution was to configure the maven-compiler plugin as follows:
here for a quick overview of maven-compiler-plugin the site Help Center Detailed answers to any questions you might have jaxb2-maven-plugin Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company http://stackoverflow.com/questions/882295/maven-compilation-error-duplicate-classes Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, http://stackoverflow.com/questions/19544572/eclipse-maven-plugin-duplicate-class-error just like you, helping each other. Join them; it only takes a minute: Sign up Eclipse Maven Plugin: Duplicate Class Error up vote 0 down vote favorite I'm trying to deploy my project using Maven in Eclipse, but I am getting a lot of duplicate class errors. Here is my pom.xml:
Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: Ant, Maven and Other Build Tools duplicate https://coderanch.com/t/108527/tools/duplicate-class-error-compiling-ant class error when compiling with ant Baiju Varugese Ranch Hand Posts: 74 posted 10 years ago hi, i am getting following error while building the project using ant, if i compile the same file with javac i it compiling fine. Compiling 252 source files to D:\ProjectBuild\PMTP3\temp\WEB-INF\classes [javac] D:\ProjectBuild\PMTP3\source\java\com\otx\pms\actions\si\AddStrategicIssue.java:56: duplicate class: com.otx.pms.actions.si.AddStrategicIssue [javac] public class AddStrategicIssue extends duplicate class Action please help me Srikanth Raghavan Ranch Hand Posts: 389 posted 10 years ago Well, I am not an expert with ant. But I had a similar issue wherein I had a class in two jar files. So, it errored out in a similar way. See if you have two jar files containing the same class. maven duplicate class Matt Harrah Ranch Hand Posts: 54 posted 10 years ago The problem here is NOT the fact that you have the class defined in two jars. When you have the same class in more than one jar, the classpath mechanism will ensure that the first one is used and the second one is ignored silently, so this is not your error. The problem here is that you have source for the same class/package in more than one location/directory trying to get compiled in the same task. Srikanth Raghavan Ranch Hand Posts: 389 posted 10 years ago I apologize for not reading the question properly. I guess Matt is right. Sorry for misleading. Consider Paul's rocket mass heater. Post Reply Bookmark Topic Watch Topic New Topic Similar Threads Eclips error Sun webservices tutorial Javac compile error webservice compiler error Javac error All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton