pom.xml Element connectors is not allowed here


当我配置一个项目的pom.xml文件时,其中如下, 红色部分报错:Element connectors is not allowed here

原因:这实际上是Intellj软件的一个bug,有时候它不能正确的识别一些配置属性(即使相应的插件有这个属性)。只需要忽略这个错误提示即可,项目能够正常工作、不受影响。

<build>
   <finalName>${war.name}finalName>
   <plugins>
      <plugin>
         <groupId>org.eclipse.jettygroupId>
         <artifactId>jetty-maven-pluginartifactId>
         <version>9.2.18.v20160721version>
         <configuration>
            <scanIntervalSeconds>5scanIntervalSeconds>
            <webAppConfig>
               <contextPath>/contextPath>
            webAppConfig>
            <contextXml>${project.basedir}/src/test/resources/jetty-context.xmlcontextXml>
            <connectors>
               <connector implementation="org.eclipse.jetty.nio.SelectChannelConnector">
                  <port>8080port>
                  <requestHeaderSize>8192requestHeaderSize>
                  <requestBufferSize>2097152requestBufferSize>
               connector>
            connectors>
            <scanTargetPatterns>
               <scanTargetPattern>
                  <directory>src/main/webapp/WEB-INFdirectory>
                  <excludes>
                     <exclude>**/*.jspexclude>
                  excludes>
                  <includes>
                     <include>**/*.propertiesinclude>
                     <include>**/*.xmlinclude>
                  includes>
               scanTargetPattern>
            scanTargetPatterns>
         configuration>
      plugin>
      <plugin>
         <groupId>org.mybatis.generatorgroupId>
         <artifactId>mybatis-generator-maven-pluginartifactId>
         <version>1.3.5version>
         <configuration>
            
            <configurationFile>${project.basedir}/src/test/resources/generatorConfig.xmlconfigurationFile>
            <verbose>trueverbose>
            <overwrite>trueoverwrite>
         configuration>
         <dependencies>
            <dependency>
               <groupId>org.mybatis.generatorgroupId>
               <artifactId>mybatis-generator-coreartifactId>
               <version>1.3.2version>
            dependency>
         dependencies>
      plugin>
      <plugin>
         <artifactId>maven-compiler-pluginartifactId>
         <version>2.3.2version>
         <configuration>
            <source>${java.version}source>
            <target>${java.version}target>
            <encoding>${java.encoding}encoding>
         configuration>
      plugin>
      <plugin>
         <artifactId>maven-resources-pluginartifactId>
         <configuration>
            <encoding>${resource.encoding}encoding>
         configuration>
      plugin>
      <plugin>
         <groupId>org.apache.maven.pluginsgroupId>
         <artifactId>maven-surefire-pluginartifactId>
         <version>2.12.4version>
         <configuration>
            <includes>
               <include>**/*Test.javainclude>
            includes>
         configuration>
         <dependencies>
            <dependency>
               <groupId>org.apache.maven.surefiregroupId>
               <artifactId>surefire-junit47artifactId>
               <version>2.12.4version>
            dependency>
         dependencies>
      plugin>

      <plugin>
         <groupId>org.apache.maven.pluginsgroupId>
         <artifactId>maven-eclipse-pluginartifactId>
         <version>2.6version>
         <configuration>
            <sourceIncludes>
               <sourceInclude>*sourceInclude>
            sourceIncludes>
            <downloadSources>truedownloadSources>
            <ajdtVersion>noneajdtVersion>
         configuration>
      plugin>
      <plugin>
         <groupId>org.apache.maven.pluginsgroupId>
         <artifactId>maven-war-pluginartifactId>
         <version>2.6version>
      plugin>
   plugins>
   <resources>
      <resource>
         <directory>${project.basedir}/src/main/resourcesdirectory>
         <includes>
            <include>**/*include>
         includes>
      resource>
      <resource>
         <directory>${project.basedir}/src/main/resourcesdirectory>
         <filtering>truefiltering>
         <includes>
            <include>**/*.propertiesinclude>
         includes>
      resource>
   resources>
   <testResources>
      <testResource>
         <directory>${project.basedir}/src/test/resourcesdirectory>
         <includes>
            <include>**/*include>
         includes>
      testResource>
   testResources>
build>

你可能感兴趣的:(18,maven)