如何解決Assembly Plugin中無法識別的標記錯誤

[英]How to solve Unrecognized Tag error in Assembly Plugin


I am working on Maven Assembly Project and i have no errors at all in Project ,i used Eclipse for this but when i build using Goal-clean package assembly:single or mvn package then i got Build failure.

我正在使用Maven Assembly Project,我在Project中沒有任何錯誤,我使用了Eclipse,但是當我使用目標清理包程序集構建時:單個或mvn包然后我遇到了構建失敗。

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.echo360.ess-plugins:ess-moodle-plugin:jar:2.5.15-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 64, column 19
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building EchoSystem Server Moodle Publishing Plugin 2.5.15-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ess-moodle-plugin ---
[INFO] Deleting E:\moodle-example\target
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ ess-moodle-plugin ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 7 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ ess-moodle-plugin ---
[INFO] Compiling 2 source files to E:\moodle-example\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ ess-moodle-plugin ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\moodle-example\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ ess-moodle-plugin ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ ess-moodle-plugin ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ess-moodle-plugin ---
[INFO] Building jar: E:\moodle-example\target\ess-moodle-plugin-2.5.15-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-assembly-plugin:2.2-beta-5:attached (default) @ ess-moodle-plugin ---
[INFO] Reading assembly descriptor: src/main/assembly/publisher.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.582s
[INFO] Finished at: Thu Feb 13 16:11:44 IST 2014
[INFO] Final Memory: 14M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:attached (default) on project ess-moodle-plugin: Error reading assemblies: Error reading descriptor at: src/main/assembly/publisher.xml: Unrecognised tag: 'binaries' (position: START_TAG seen ...</dependencySets>\r\n    <binaries>... @25:15) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Here is my POM.xml

這是我的POM.xml

<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/maven-v4_0_0.xsd">  
  <modelVersion>4.0.0</modelVersion>  
  <groupId>com.echo360.ess-plugins</groupId>  
  <artifactId>ess-moodle-plugin</artifactId>  
  <packaging>jar</packaging>
  <name>EchoSystem Server Moodle Publishing Plugin</name>  
  <build> 
    <plugins> 
      <plugin> 
        <artifactId>maven-assembly-plugin</artifactId>  
        <inherited>false</inherited>  
        <executions> 
          <execution> 
            <phase>package</phase>  
            <goals> 
              <goal>attached</goal> 
            </goals>  
            <configuration>

              <archive>
                <manifest>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
                <manifestEntries>
                  <Implementation-Time>${buildNumber}</Implementation-Time> 
                </manifestEntries>
              </archive>
              <descriptors>
                <descriptor>src/main/assembly/publisher.xml</descriptor> 
              </descriptors> 
              <outputDirectory>${project.build.directory}</outputDirectory>
              <workDirectory>${project.build.directory}/assembly/work</workDirectory>
            </configuration>
          </execution> 
        </executions> 
      </plugin>  
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins> 
  </build>  
  <profiles> 
    <profile> 
      <id>non-anystream-env</id>  
      <activation> 
        <property> 
          <name>!running-on-anystream-net</name> 
        </property> 
      </activation>  
      <build> 
        <plugins> 
          <plugin> 
            <groupId>org.apache.maven.plugins</groupId>  
            <artifactId>maven-surefire-plugin</artifactId>  
            <configuration> 
              <skip>true</skip> 
            </configuration>  
            <executions> 
              <execution> 
                <id>surefire-ut</id>  
                <phase>unit-test</phase>  
                <goals> 
                  <goal>test</goal> 
                </goals>  
                <configuration> 
                  <skip>false</skip> 
                </configuration> 
              </execution> 
            </executions> 
          </plugin> 
        </plugins> 
      </build> 
    </profile> 
  </profiles>  
  <dependencies> 
    <!-- compile scope -->  
    <dependency>
      <groupId>com.echo360.ess</groupId>
      <artifactId>ess-plugin-sdk</artifactId>
      <version>2.5.15-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.echo360.ess</groupId>
      <artifactId>ess-plugin-lib</artifactId>
      <version>2.5.15-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.echo360.ess</groupId>
      <artifactId>ess-property</artifactId>
      <version>2.5.15-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>xmlrpc</groupId>
      <artifactId>xmlrpc</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.3</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.5.6</version>
    </dependency>
  </dependencies>  
  <version>2.5.15-SNAPSHOT</version>
</project>

Here is my publisher.xml

這是我的publisher.xml

<assembly>
    <id>publisher</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
            <scope>compile</scope>
            <includes>
                <include>commons-codec:commons-codec</include>
                <include>xmlrpc:xmlrpc</include>
            </includes>
            <outputDirectory>lib</outputDirectory>
        </dependencySet>
    </dependencySets>
    <binaries>
        <includeDependencies>true</includeDependencies>
    </binaries>
    <fileSets>
        <!-- classes -->
        <fileSet>
            <directory>${project.build.directory}/classes</directory>
            <outputDirectory>/classes</outputDirectory>
            <excludes>
                <exclude>META-INF</exclude>
                <exclude>META-INF/*</exclude>
                <exclude>**/*_ar.properties</exclude>
                <exclude>**/*_de.properties</exclude>
                <exclude>**/*_es.properties</exclude>
                <exclude>**/*_ja.properties</exclude>
            </excludes>
        </fileSet>
        <!-- plugin.xml -->
       <fileSet>
            <directory>src/main/resources/META-INF</directory>
            <outputDirectory>/META-INF</outputDirectory>
            <includes>
                <include>plugin.xml</include>
            </includes>
        </fileSet>

    </fileSets>
</assembly>

Here is my structure: enter image description here

這是我的結構:

1 个解决方案

#1


2  

Please try with this: Add "The assembly:" before the . Hope this will work.

請嘗試這樣:在之前添加“程序集:”。希望這會奏效。

 </project>
  The assembly:
  <assembly>
    <id>jar-with-dependencies</id>
    <formats>
      <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
      <dependencySet>
         <unpack>true</unpack>

         <unpackOptions>
            <excludes>
               <exclude>*.properties</exclude>
            </excludes>
          </unpackOptions>

      </dependencySet>
    </dependencySets>
    <fileSets>
      <fileSet>
        <directory>target/classes</directory>
      </fileSet>
    </fileSets>
  </assembly>

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/02/13/4000238c58572a4cdb56d9701dfc76a3.html



 
  © 2014-2022 ITdaan.com 联系我们: