当我运行此命令时:
mvn clean package -DskipTests -Ddevkit.studio.package.skip=false
我收到此错误:
...
[INFO] Adding registry bootstrap entry for org.apache.solr.client.solrj.transformers.ORDEREnumTransformer as ORDEREnumTransformer
[ERROR] Could not create MANIFEST for Studio plugin: Attempt to reopen a file for path MANIFEST.MF
[ERROR] error on execute: An error ocurred while the DevKit was generating Java code. Check the logs for further details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.772s
[INFO] Finished at: Tue May 13 20:48:10 PDT 2014
[INFO] Final Memory: 25M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mule.tools.devkit:mule-devkit-maven-plugin:3.3.0:generate-sources (default-generate-sources) on project mule-module-solr: An error ocurred while the DevKit was generating Java code. Check the logs for further details. -> [Help 1]
...
有些奇怪的事情:
如果我从mvn clean package -DskipTests -Ddevkit.studio.package.skip=false
更改为mvn clean package -DskipTests -Ddevkit.studio.package.skip=true
,但它还没有完成任务。
我从工作项目fork here开始,在那里我可以使用...skip=false
运行完整命令。我只在src/main/java/org/mule/modules
添加了一个额外的类,我相信它遵循注释模式,并且更加简单。 (还不能真正共享该代码)并添加了2个依赖项:httpclient
和jackson-databind
。它会对这两个类进行所有检查,[INFO] Searching for classes annotated with @Connector
然后[INFO] Validating MyXyzConnector class
我考虑的问题/事情:
-Ddevkit.studio.package.skip=false
告诉它生成一个.zip文件?...Attempt to reopen a file ...
的错误部分听起来像是并发问题??? <mule.devkit.version>3.3.0</mule.devkit.version>
不知道下一步该去哪里。
答案 0 :(得分:0)
显然,错误是由项目中有多个连接器类引起的。您可以拥有多个.java文件,但我认为只有1个可以拥有@Connector
注释。
我首先暂时删除了我的新课程,然后创建了一个最小的HelloWorldConnector.java
连接器(如下所示)。它还生成了相同的MANIFEST错误。当我将原始作品SolrConnector.java
重命名为SolrConnector.java-MOVED
并使用-Ddevkit.studio.package.skip=false
重新构建版本时,它工作正常并生成target/UpdateSite.zip
文件。我真是无益的错误信息...
HelloWorldConnector.java 最小连接器测试:
package org.mule.modules;
import org.mule.api.ConnectionException;
import org.mule.api.ConnectionExceptionCode;
import org.mule.api.annotations.*;
import org.mule.api.annotations.display.FriendlyName;
import org.mule.api.annotations.display.Placement;
import org.mule.api.annotations.param.Default;
import org.mule.api.annotations.param.Optional;
import org.mule.api.annotations.param.Payload;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Module for debugging
*
* {@sample.xml ../../../doc/solr-connector.xml.sample solr:config}
*
* @author Mark
*/
@Connector(name = "hello", schemaVersion = "1.0.0", friendlyName = "Hello", minMuleVersion = "3.3.0")
public class HelloWorldConnector {
/**
* Connect to the Solr Server using commons http client gateway.
*/
@Connect
public synchronized void connectHello() throws ConnectionException {
}
/**
* Disconnect from the server, nothing special needed at this time.
*/
@Disconnect
public synchronized void disconnectHello() {
}
/**
* Identify the connection.
*
* @return null, not used at this time.
*/
@ConnectionIdentifier
public String connectionIdentifierHello() {
return null;
}
/**
* Validate the connection by sending a ping request.
*
* @return true if the ping call succeeds, false otherwise.
*/
@ValidateConnection
public boolean isConnectedHello() {
return true;
}
}