webentwicklung-frage-antwort-db.com.de

Maven: Ungültiger Inhalt wurde gefunden mit Element 'plugin'

Ich habe meine pom.xml mit Plagins aktualisiert und einen Fehler erhalten:

 cvc-complex-type.2.4.a: Invalid content was found starting with element 'plugin'. One of      '{"http://maven.Apache.org/POM/
 4.0.0":parent, "http://maven.Apache.org/POM/4.0.0":description, "http://maven.Apache.org/POM/4.0.0":prerequisites, 
 "http://maven.Apache.org/POM/4.0.0":issueManagement, "http://maven.Apache.org/POM/4.0.0":ciManagement,  "http://
 maven.Apache.org/POM/4.0.0":inceptionYear, "http://maven.Apache.org/POM/4.0.0":mailingLists, "http://
 maven.Apache.org/POM/4.0.0":developers, "http://maven.Apache.org/POM/4.0.0":contributors, "http://maven.Apache.org/
 POM/4.0.0":licenses, "http://maven.Apache.org/POM/4.0.0":scm,   "http://maven.Apache.org/POM/4.0.0":organization, 
 "http://maven.Apache.org/POM/4.0.0":build, "http://maven.Apache.org/POM/4.0.0":profiles, "http://maven.Apache.org/
 POM/4.0.0":modules, "http://maven.Apache.org/POM/4.0.0":repositories, "http://maven.Apache.org/POM/
 4.0.0":pluginRepositories, "http://maven.Apache.org/POM/4.0.0":reports,  "http://maven.Apache.org/POM/4.0.0":reporting, 
 "http://maven.Apache.org/POM/4.0.0":dependencyManagement, "http://maven.Apache.org/POM/
 4.0.0":distributionManagement}' is expected.

Dies ist die pom.xml-Datei:

    <project xmlns="http://maven.Apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.Apache.org/POM/4.0.0 http://maven.Apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>test</name>
<url>http://maven.Apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>Oracle</groupId>
        <artifactId>ojdbc16</artifactId>
        <version>11.2.0.1.0</version>
        <type>jar</type>
    </dependency>
</dependencies>
<plugin>
   <groupId>org.Apache.cxf</groupId>
   <artifactId>cxf-Java2ws-plugin</artifactId>
   <version>2.5.1</version>
   <dependencies>
      <dependency>
         <groupId>org.Apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-jaxws</artifactId>
         <version>2.5.1</version>
      </dependency>
      <dependency>
         <groupId>com.company.app</groupId>
         <artifactId>services</artifactId>
         <version>0.0.1-SNAPSHOT</version>
      </dependency>
   </dependencies>
   <executions>
      <execution>
         <id>generate-sources</id>
         <phase>generate-sources</phase>
         <configuration>
            <className>com.company.app.services.WebServiceBean</className>
            <genWsdl>true</genWsdl>
         </configuration>
         <goals>
            <goal>Java2ws</goal>
         </goals>
      </execution>
   </executions>
</plugin>
<plugin>
   <groupId>org.Apache.cxf</groupId>
   <artifactId>cxf-codegen-plugin</artifactId>
   <version>2.5.1</version>
   <executions>
      <execution>
         <id>process-sources</id>
         <phase>generate-sources</phase>
         <configuration>
            <wsdlOptions>
               <wsdlOption>
                  <wsdl>${project.build.directory}/generated/wsdl/WebServiceBean.wsdl</wsdl>
                  <extraargs>
                     <extraarg>-p</extraarg>
                     <extraarg>com.company.app.services.client.model</extraarg>
                  </extraargs>
               </wsdlOption>
            </wsdlOptions>
         </configuration>
         <goals>
            <goal>wsdl2Java</goal>
         </goals>
      </execution>
   </executions>
</plugin>
</project>

Wie löse ich das?

13
khris

Sie müssen den folgenden Teil in Ihre POM-Datei einfügen:

<build>
  <plugins>
   ...<plugin>
      </plugin>
  </plugins>
</build>
29
khmarbaise

Sie müssen Ihren Code zwischen hinzufügen,

<build>
  <plugins>
      <plugin>
      </plugin>
  </plugins>
</build>

Falls Sie über mehrere Plugins verfügen, fügen Sie unter <plugin> ein weiteres <plugins>-Tag hinzu.

2
Rishabh Agarwal