Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor

后端 未结 14 845
执念已碎
执念已碎 2021-01-30 12:27
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[IN         


        
相关标签:
14条回答
  • 2021-01-30 12:41

    Instead of changing JDK versions and Maven versions, try this:

    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
        <version>2.3.2</version>
    </plugin>
    
    0 讨论(0)
  • 2021-01-30 12:41

    Try to delete all your cache. When i deleted target folder, it works fine.

    (Target folder is where maven puts all compiled code)

    0 讨论(0)
  • 2021-01-30 12:44

    if your using jdk 1.6 kindly add this plugin entry to your pom.xml

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <compilerArgument>-Xlint:all</compilerArgument>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
        </configuration>
    </plugin>
    
    0 讨论(0)
  • 2021-01-30 12:45

    Make sure to have the JDK version in your Build path and the version specified in the source tag match the same.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.1</version>
        <configuration>
         **<source>1.7</source>**
           <target>1.7</target>
           <debug>true</debug>
        </configuration>
    </plugin> `
    

    I had the build path pointing to jdk 1.7 and "1.6" in the source tag, when I corrected the version to 1.7 in source tag the issue got resolved.

    Execute mnv clean and mvn package.

    0 讨论(0)
  • 2021-01-30 12:47

    Perhaps a version of maven war plugin is being used, which does not work with Java 7? As per this issue (which describes a similar problem), 2.1.1 version of maven war plugin should work.

    Include the following in your pom.xml

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
    </plugin>
    
    0 讨论(0)
  • 2021-01-30 12:47

    I had this problem with my eclipse Kepler. As soon as I moved to 4.4 (Luna) , all gone. Must be an issue with eclipse + maven embedded

    I tried both JDK 1.7 and 1.8. No difference.

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