2015-10-15 23 views
0

我試圖讓Maven的 - /測試/班不是目錄 - 錯誤

mvn clean package 

在有這個pom.xml的一個項目:

<?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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.alfdev.alfresco</groupId> 
    <artifactId>create-link-share</artifactId> 
    <version>1.0.0</version> 
    <name>create-link-share AMP project</name> 
    <packaging>amp</packaging> 
    <description>Manages the lifecycle of the create-link-share AMP (Alfresco Module Package)</description> 

    <parent> 
     <groupId>org.alfresco.maven</groupId> 
     <artifactId>alfresco-sdk-parent</artifactId> 
     <version>1.1.1</version> 
    </parent> 

    <!-- 
     | SDK properties have sensible defaults in the SDK parent, 
     | but you can override the properties below to use another version. 
     | For more available properties see the alfresco-sdk-parent POM. 
     --> 
    <properties> 
     <!-- Defines the alfresco edition to compile against. Allowed values are [org.alfresco|org.alfresco.enterprise]--> 
     <alfresco.groupId>org.alfresco</alfresco.groupId> 
     <!-- Defines the alfresco version to compile against --> 
     <alfresco.version>5.0.d</alfresco.version> 
     <app.log.root.level>WARN</app.log.root.level> 
     <alfresco.data.location>alf_data_dev</alfresco.data.location> 
     <!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war switch 
     . | Allowed values: alfresco | share. Defaults to a repository AMP, but could point to your foundation WAR --> 
     <alfresco.client.war>share</alfresco.client.war> 
     <!-- Defines the target WAR groupId to run this amp, only used with the -Pamp-to-war switch 
     . | Could be org.alfresco | org.alfresco.enterprise or your corporate groupId --> 
     <alfresco.client.war.groupId>org.alfresco</alfresco.client.war.groupId> 
     <!-- Defines the target WAR version to run this amp, only used with the -Pamp-to-war switch --> 
     <alfresco.client.war.version>5.0.d</alfresco.client.war.version> 
     <!-- This controls which properties will be picked in src/test/properties for embedded run --> 
     <env>local</env> 
    </properties> 

    <!-- Here we realize the connection with the Alfresco selected platform 
     (e.g.version and edition) --> 
    <dependencyManagement> 
     <dependencies> 
      <!-- This will import the dependencyManagement for all artifacts in the selected Alfresco version/edition 
       (see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies) 
       NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement. NOTE: It defaults 
       to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom --> 
      <dependency> 
       <groupId>${alfresco.groupId}</groupId> 
       <artifactId>alfresco-platform-distribution</artifactId> 
       <version>${alfresco.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 
    <!-- Following dependencies are needed for compiling Java code in src/main/java; 
     <scope>provided</scope> is inherited for each of the following; 
     for more info, please refer to alfresco-platform-distribution POM --> 
    <dependencies> 
     <dependency> 
      <groupId>${alfresco.groupId}</groupId> 
      <artifactId>alfresco-repository</artifactId> 
     </dependency> 
     <!-- Test dependencies --> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <!-- This repository is only needed to retrieve Alfresco parent POM. 
     NOTE: This can be removed when/if Alfresco will be on Maven Central 

     NOTE: The repository to be used for Alfresco Enterprise artifacts is 
     https://artifacts.alfresco.com/nexus/content/groups/private/. Please check 
     with Alfresco Support to get credentials to add to your ~/.m2/settings.xml 
     if you are a Enterprise customer or Partner 
     --> 
    <repositories> 
     <repository> 
      <id>alfresco-public</id> 
      <url>https://artifacts.alfresco.com/nexus/content/groups/public</url> 
     </repository> 
     <repository> 
      <id>alfresco-public-snapshots</id> 
      <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url> 
      <snapshots> 
       <enabled>true</enabled> 
       <updatePolicy>daily</updatePolicy> 
      </snapshots> 
     </repository> 
    </repositories> 
    <build> 
     <pluginManagement> 
      <plugins> 
       <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> 
       <plugin> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId> 
              org.alfresco.maven.plugin 
             </groupId> 
             <artifactId> 
              alfresco-maven-plugin 
             </artifactId> 
             <versionRange> 
              [1.1.1,) 
             </versionRange> 
             <goals> 
              <goal>set-version</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore></ignore> 
            </action> 
           </pluginExecution> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId> 
              org.codehaus.mojo 
             </groupId> 
             <artifactId> 
              build-helper-maven-plugin 
             </artifactId> 
             <versionRange> 
              [1.8,) 
             </versionRange> 
             <goals> 
              <goal> 
               add-test-resource 
              </goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore></ignore> 
            </action> 
           </pluginExecution> 
          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
</project> 

但我得到的錯誤:

[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building create-link-share AMP project 1.0.0 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-sdk-requirements) @ create-link-share --- 
[INFO] 
[INFO] --- alfresco-maven-plugin:1.1.1:set-version (default-set-version) @ create-link-share --- 
[INFO] Added timestamp to version - 1.0.0.1510150908 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ create-link-share --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory /home/p/Documentos/alfresco-share-create-link-v1.0.0/create-link-share.amp_FILES/META-INF/maven/com.alfdev.alfresco/create-link-share/src/main/resources 
[INFO] skip non existing resourceDirectory /home/p/Documentos/alfresco-share-create-link-v1.0.0/create-link-share.amp_FILES/META-INF/maven/com.alfdev.alfresco/create-link-share/src/main/amp 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ create-link-share --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ create-link-share --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ create-link-share --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ create-link-share --- 
[INFO] 
[INFO] --- alfresco-maven-plugin:1.1.1:amp (default-amp) @ create-link-share --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.305 s 
[INFO] Finished at: 2015-10-15T09:08:19+01:00 
[INFO] Final Memory: 19M/259M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.alfresco.maven.plugin:alfresco-maven-plugin:1.1.1:amp (default-amp) on project create-link-share: Error creating JAR: /home/p/Documentos/alfresco-share-create-link-v1.0.0/create-link-share.amp_FILES/META-INF/maven/com.alfdev.alfresco/create-link-share/target/classes isn't a directory. -> [Help 1] 

我該如何解決這個問題?我試圖運行這個項目:

https://github.com/skomarica/alfresco-share-create-link

在這種情況下的創建鏈接共享。

請幫幫我。

編輯:與命令

mvn clean package

這創建/目標/測試的類和不/目標/類。

回答

1

它似乎試圖找到共享的測試類,它無法在alfresco共享項目中找到該目錄,因爲沒有創建測試類。

您可以使用以下命令跳過執行測試類。

mvn package -DskipTests=true 
+0

這不是解決了問題:\ – PRVS

1

好像你的項目沒有任何資源可以編譯。

這是不一致的,沒有資源和源代碼,沒有測試資源和測試源代碼結束了/測試類,但沒有/類。我能看到的唯一區別是資源插件跳過了不存在的目錄,因此可能不會創建目錄。

我想這是一個問題。

+0

如果你的項目的根目錄是/ home/P /文件/alfresco-share-create-link-v1.0.0/create-link-share.amp_FILES/META-INF/maven/com.alfdev.alfresco/create-link-share。 – user392486

+0

我不知道......我只有在這個地方的maven ......但代碼之前......我不知道如何編譯這個結構。如果是正確的方法。 – PRVS

1

如果你想忽略執行露天-Maven的插件:1.1.1:AMP,試試這個

<pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId> 
              org.alfresco.maven.plugin 
             </groupId> 
             <artifactId> 
              alfresco-maven-plugin 
             </artifactId> 
             <versionRange> 
              [1.1.1,) 
             </versionRange> 
             <goals> 
              <goal>amp</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore></ignore> 
            </action> 
           </pluginExecution> 
+0

未解決問題:S – PRVS

相關問題