2016-09-21 55 views
0

要創建一個適配器Maven項目錯誤,同時部署適配器

新建 - >項目 - >的Maven - > Maven項目

然後包括結構的項目

配置→添加本地目錄→瀏覽至主目錄中的/.m2/repository/archetype-catalog.xml。

然後添加原型:然後

Archetype Group Id: com.ibm.mfp 
Archetype Artifact Id:adapter-maven-archetype-http 
Archetype Version: 8.0.2016061011 

建築適配器

右鍵點擊項目 - >運行方式 - > Maven的安裝

我安慰我收到使成功

然後用於部署適配器

右鍵單擊編輯項目 - 我收到錯誤的

[INFO] Scanning for projects... 
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for Mobile:sampleAdapter:adapter:0.0.1-SNAPSHOT 
[WARNING] 'build.plugins.plugin.version' for com.ibm.mfp:adapter-maven-plugin is missing. @ line 44, column 12 
[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 sampleAdapter 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.970 s 
[INFO] Finished at: 2016-09-22T11:20:42+05:30 
[INFO] Final Memory: 6M/64M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Unknown lifecycle phase "Maven". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException 

有了這個> Maven構建

但我有原型 - catalog.xml文件 (我創造了這個文件,並粘貼到 - >運行方式/.m2/repository)

<?xml version="1.0" encoding="UTF-8"?> 
<archetype-catalog  xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0 http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd" 
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<archetypes> 
<archetype> 
<groupId>com.ibm.mfp</groupId> 
<artifactId>adapter-maven-archetype-http</artifactId> 
<version>8.0.2016061011</version> 
    <repository>https://mvnrepository.com/artifact/com.ibm.mfp/adapter-maven-archetype-http</repository> 
</archetype> 
    <archetype> 
    <groupId>com.ibm.mfp</groupId> 
<artifactId>adapter-maven-plugin</artifactId> 
<version>8.0.2016082422</version> 
     <repository>https://mvnrepository.com/artifact/com.ibm.mfp/adapter-maven-plugin</repository> 
</archetype> 
</archetypes> 
</archetype-catalog> 

請幫我解決這個問題

+1

目前還不清楚,你在這裏做什麼?提供一步一步的再現步驟。 –

+0

簡而言之,我無法在Eclipse IDE中部署我的適配器.https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/developing-adapters/。根據此文檔,我成功構建了適配器,但同時部署我得到了錯誤 – CodeWriter

+0

再次,也就是說,用完整的再現步驟編輯問題並下載適配器進行調試。 –

回答

0

你沒有正確地履行部署階段。
在這裏看到:https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/developing-adapters/#deploying-an-adapter

要部署適配器,首先添加部署Maven的命令:

選擇運行→運行配置......,右鍵單擊Maven構建並選擇新建。
提供名稱:「Maven deploy」。
設置爲一個目標:「adapter:deploy」。
單擊應用,然後單擊運行以進行初始部署。

現在,您可以在適配器文件夾,右鍵單擊並選擇Run As→Maven的部署

+0

只有在創建新的工作空間後,我才能部署適配器。謝謝!!! – CodeWriter

相關問題