2017-08-29 7 views
1

pom.xmlファイルに問題があります。誰でも何が間違っているのか分かっていますか?複数のタグ/予想されるトークンがpom.xmlで発生する

<?xml version="1.0" encoding="UTF-8"?> 
< 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.example</groupId> 
    <artifactId>demo</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.5.6.RELEASE</version> 
    </parent> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <java.version>1.8</java.version> 
     <junit.jupiter.version>5.0.0-M3</junit.jupiter.version> 
     <junit.vintage.version>${junit.version}.0-M3</junit.vintage.version> 
     <junit.platform.version>1.0.0-M3</junit.platform.version> 
     <cucumber.version>1.2.5</cucumber.version> 
     <mysql.connector.version>6.0.5</mysql.connector.version> 
     <jooq.verson>3.9.1</jooq.verson> 
    </properties> 

    <plugin> 
     <plugins> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 
       <configuration> 
       <source>${java.version}</source> 
        <target>${java.version}</target> 
       </configuration> 
      </plugin> 
     </plugins> 

     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.19.1</version> 
     <configuration> 
     <include> 
     <include>**/Test*.java</include> 
      <include>**/*Test.java</include> 
      <include>**/*Tests.java</include> 
      <include>**/*TestCase.java</include> 
      <include>**/*Runner.java</include> 
     </include> 
     </configuration> 

     <dependencies> 
     <dependency> 
      <groupId>org.junit.platform</groupId> 
      <artifactId>junit-platform-surefire-provider</artifactId> 
      <version>LATEST</version> 
     </dependency> 

      <dependency> 
       <groupId>org.junit.jupiter</groupId> 
       <artifactId>junit-jupiter-engine</artifactId> 
       <version>LATEST</version> 
      </dependency> 
      <dependency> 
       <groupId>org.junit.vintage</groupId> 
       <artifactId>junit-vintage-engine</artifactId> 
       <version>${junit.jupiter.version}</version> 
      </dependency> 
     </dependencies> 
    </plugin> 

<plugin> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-maven-plugin</artifactId> 
</plugin> 

<plugin> 
<groupId>org.liquidbase</groupId> 
<artifactId>liduidbase</artifactId> 
<version>3.0.5</version> 
</plugin> 

<configuration> 

<driver>com.mysql.cj.jdbc.Driver</driver> 
<url>jdbc:mysql://127.0.0.1:33306/monster_app?nullNamePatternMatchesAll=true</url> 
<username>monster_user</username> 
<password>monster_password</password> 
<changeLogFile>src/main/java/com/example/changelog-master.xml</changeLogFile> 
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase> 
</configuration> 
<executions> 
<execution> 
    <phase>process-resources</phase> 
    <goals> 
     <goal>update</goal> 
    </goals> 
</execution> 
</executions> 
     </plugin> 
<groupId>org.jooq</groupId> 
<artifactId>jooq-codegen-maven</artifactId> 
<configuration> 
<jdbc> 
<driver>com.mysqk.cj.jdbc.Driver</driver> 
    <url>jdbc:mysql://127.0.0.1:33306/monster_app?nullNamePatternMatchesAll=true</url> 
    <username>monster_user</username> 
    <password>monster_password</password> 
</jdbc> 
<generator> 
    <name>org.jooq.util.JavaGenerator</name> 
    <database> 
    <name>org.jooq.util.mysql.MySQLDatabase</name> 
    <inputSchema>monster_app</inputSchema> 
    <includes>.*</includes> 
    </database> 

    <target> 

    <packageName>com.example.Generated</packageName> 
     <directory>src/main/java</directory> 
    </target> 
</generator> 
</configuration> 

<dependencies> 
<dependency> 
<groupId>org.junit.jupiter</groupId> 
    <version>${junit.jupiter.version}</version> 
    <scope>test</scope> 

</dependency> 

<dependency> 
<groupId>junit</groupId> 
    <artifactId>junit</artifactId> 
    <version>${junit.version}</version> 
    <scope>test</scope> 
</dependency> 

</dependencies> 

<repositories> 
<repository> 
<id>sonatype-snapshots</id> 
<url>https://oss.sonatype.org/content/repositories/snapshots</url> 
<snapshots> 
    <enabled>true</enabled> 
</snapshots> 
</repository> 
</repositories> 

<dependencies> 

<dependency> 
<groupId>info.cukes</groupId> 
<artifactId>cucumber-junit</artifactId> 
<version>${cucumber.version}</version> 
<scope>test</scope> 
</dependency> 

<dependency> 
<groupId>info.cukes</groupId> 
<artifactId>cucumber-java8</artifactId> 
<version>${cucumber.version</version> 
<scope>test</scope> 
</dependency> 

<dependency> 
<groupId>info.cukes</groupId> 
<artifactId>cucumber-jvm</artifactId> 
<version>1.0.11</version> 
<type>pom</type> 
</dependency> 

<dependency> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-starter-web</artifactId> 
</dependency> 


<dependency> 
<groupId>info.cukes</groupId> 
<artifactId>cucumber-spring</artifactId> 
<version>1.2.5</version> 
<scope>test</scope> 
</dependency> 

<dependency> 
<groupId>com.h2database</groupId> 
<artifactId>h2</artifactId> 
<scope>runtime</scope> 
</dependency> 

<dependency> 
<groupId>mysql</groupId> 
    <artifactId>mysql-connector-java</artifactId> 
    <version>${mysql.connector.version}</version> 
</dependency> 


<dependency> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-starter-test</artifactId> 
<scope>test</scope> 
</dependency> 

<dependency> 
<groupId>org.jooq</groupId> 
    <artifactId>jooq</artifactId> 
    <version>${jooq.version}</version> 
</dependency> 

<dependency> 
    <groupId>org.jooq</groupId> 
    <artifactId>jooq-meta</artifactId> 
<version>${jooq.version}</version> 
</dependency> 
<dependency> 
<artifactId>org.jooq</artifactId> 
    <groupId>jooq-codegen</groupId> 
    <version>${jooq.version}</version> 
</dependency> 

<dependency> 
<groupId>org.codehaus.jackson</groupId> 
    <artifactId>jackson-mapper-asl</artifactId> 
    <version>1.9.13</version> 
</dependency> 

<dependency> 
<groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-jdbc</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-test</artifactId> 
    <version>4.3.10.RELEASE</version> 
    <scope>test</scope> 
</dependency> 

<dependency> 
<groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-test</artifactId> 
    <version>1.5.6.RELEASE</version> 
    <scope>test</scope> 
</dependency> 


<dependency> 
<groupId>junit</groupId> 
    <artifactId>junit</artifactId> 
    <version>4.12</version> 
</dependency> 

</dependencies> 
</project> 

何が間違っているのか分かりません。最初の3行は私に複数のタグエラーを与え、最後の行は私に予期しないトークンを与えます。

このコードは他の人のマシンで試されていますが、正常に動作しているようです。 私はそこに奇妙なことがあるとは思わないが、まだ私のために働いていない。

答えて

2

あなたはちょうどprojectというタグ名がありません。

<?xml version="1.0" encoding="UTF-8"?> 
<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"> 
0

そこには、複数の構造上の問題は、私は以下のそれらのカップルをリストアップしましょう、あなたのpom.xmlに表示されます。

  1. 二行目はこのように、タグとしてプロジェクトを持っている必要があります。

    http://maven.apache.org/xsd/maven-4.0.0.xsd ">

  2. は、タグの中に存在しなければならない、とすべてのタグは、タグ内に常駐し、その後 必要があります。

  3. タグは、特定のタグ内に存在する必要があります。

EclipseなどのIDEを使用している場合、Ctrl + Spaceキーを押して各タグの候補を表示することをお勧めします。これにより、タグを関連するセクションに移動するのに役立ちます。また、セクションの上にすべての依存関係を保持する必要があります。

関連する問題