Mule devkit错误:[错误]无法为Studio插件创建MANIFEST:尝试重新打开路径MANIFEST.MF的文件

时间:2014-05-14 04:16:26

标签: maven zip package mule

当我运行此命令时:

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]
...

有些奇怪的事情:

  1. 如果我从mvn clean package -DskipTests -Ddevkit.studio.package.skip=false更改为mvn clean package -DskipTests -Ddevkit.studio.package.skip=true,但它还没有完成任务。

  2. 我从工作项目fork here开始,在那里我可以使用...skip=false运行完整命令。我只在src/main/java/org/mule/modules添加了一个额外的类,我相信它遵循注释模式,并且更加简单。 (还不能真正共享该代码)并添加了2个依赖项:httpclientjackson-databind。它会对这两个类进行所有检查,[INFO] Searching for classes annotated with @Connector然后[INFO] Validating MyXyzConnector class

  3. 我考虑的问题/事情:

    • 我认为-Ddevkit.studio.package.skip=false告诉它生成一个.zip文件?
    • 如果是,那是否需要部署?
    • 我认为.zip文件想要一个清单?
    • 关于MANIFEST文件...Attempt to reopen a file ...的错误部分听起来像是并发问题???
    • 我在pom.xml中没有看到任何提示,也没有提到工作pom.xml的提示
    • 网上有一些讨论说devkit的后续版本存在问题,人们应该回溯到3.3.0,但我检查了 我正在使用的内容在pom.xml <mule.devkit.version>3.3.0</mule.devkit.version>

    不知道下一步该去哪里。

1 个答案:

答案 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;
    }
}