2017-10-14 58 views
-2

我按照說明給Maven Help by Jetbrainsmy project。我pom.xml looks-元素「插件」不能有性格[兒童],因爲該類型的內容類型元素的唯一

<?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"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>groupId</groupId> 
    <artifactId>TextPad</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       ... 
       <configuration> 
        <archive> 
         <manifest> 
          <addClasspath>true</addClasspath> 
          <mainClass>fully.qualified.MainClass</mainClass> 
         </manifest> 
        </archive> 
       </configuration> 
       ... 
      </plugin> 
     </plugins> 
    </build> 
</project> 

pom.xml顯示錯誤。
我的項目看起來像(包括錯誤) -

enter image description here

我在Maven的新。請提供解決方案或建議,以解決我的問題。 P.S:我沒有提供有關增加問題大小的項目的所有信息。如果有任何信息需要評論。

回答

0

您從某處複製了該XML,並且那些...行指示省略了某些內容。 ...行不是字面意思,它們是XML驗證程序抱怨的原因,它們不是模式的有效部分。

要解決此問題,您必須返回到您獲取XML的位置,並瞭解所省略的內容,並在需要時提供。

+0

但我的'TextPad-1.0-SNAPSHOT.jar'不會導致任何結果。爲什麼?看到[這個圖像](https://imgur.com/a/4BOeD)。在移動到maven項目之前,我的項目運行良好,並給文本編輯器。見[此圖像](https://github.com/al2helal/TextPad/blob/master/README.md) – user7824948

+0

我從https://maven.apache.org/shared/maven-archiver/examples採取的代碼/manifestFile.html錯誤。 – user7824948

相關問題