maven compilation error: duplicate classes

后端 未结 10 497
悲&欢浪女
悲&欢浪女 2020-12-09 16:39

In my maven2 project I have a directory ${basedir}/autogen that contains some autogenerated source code files produced by wsdl2java.

When r

相关标签:
10条回答
  • 2020-12-09 17:26

    I had the exact same issue. In my case the problem was that I called maven with -f=./pom.xml. I have no idea why this leads to a different result (would be nice if someone can explain) but maybe good to know if someone else has the same issue.

    0 讨论(0)
  • 2020-12-09 17:29

    I my case helped this:

    <!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
    </dependency>
    
    0 讨论(0)
  • 2020-12-09 17:30

    I resolve it by remove generateAsync from my pom.xml the the GWT plugin will look like

                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>${gwtVersion}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                                <goal>test</goal>
                                <!-- <goal>i18n</goal> -->
    
                            </goals>
                        </execution>
                    </executions>
    
    0 讨论(0)
  • 2020-12-09 17:32

    Its hard to change default maven behaviour, i think its better to go with it - you could generate those files with maven wsdl2java-maven-plugin

    0 讨论(0)
提交回复
热议问题