Сборка Maven для Munits - Mule

Я готовлю maven для создания приложения mule, которое содержит munits. Я получаю сообщение об ошибке ниже, когда я "mvn package" приложение.

WARN 2016-11-11 09: 35: 32,415 [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: игнорируется предупреждение проверки XML org.xml.sax.SAXParseException: schema_reference.4: не удалось прочитать документ схемы 'http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd ', потому что 1) не удалось найти документ; 2) документ не читается; 3) корневого элемента документа нет. в org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException (Неизвестный источник) ~ [xercesImpl-2.8.0.jar :?] в org.apache.xerces.util.ErrorHandlerWrapper.warning (Неизвестный источник) ~ [xercesImpl-2.8. 0.jar :?]

Поток xml, о котором идет речь:

http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd ">

Ниже мой pom.xml:

<ws:consumer-config name="Web_Service_Consumer" service="Mat_RFCService" port="MAT_RFC" 
  serviceAddress="${service.address}" 
  wsdlLocation="MAT_WSDL.wsdl" doc:name="Web Service Consumer" connectorConfig="MAT-HTTP-Endpoint"/>

Любые подсказки будут большим подспорьем.

<modelVersion>4.0.0</modelVersion>
 <groupId>com.mycompany</groupId>
 <artifactId>myapplication</artifactId>
 <version>1.0.0-SNAPSHOT</version>
 <packaging>mule</packaging>
 <name>Mule myapplication Application</name>
 <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <mule.version>3.8.1</mule.version>
     <mule.tools.version>1.2</mule.tools.version>
     <munit.version>1.2.1</munit.version>
     <mule.munit.support.version>3.8.0</mule.munit.support.version>
     <!-- This is the domain where the app will be 
     deployed: i.e. mydomain.cloudhub.io -->
     <cloudhub.domain>mydomain</cloudhub.domain>
 </properties>
 <build>
     <plugins>
     <plugin>
       <groupId>org.mule.tools.maven</groupId>
       <artifactId>mule-maven-plugin</artifactId>
       <version>2.1.1</version>
       <!-- <configuration>
             <deploymentType>standalone</deploymentType>
             <muleVersion>${mule.version}</muleVersion>
         </configuration> -->
         <configuration>
             <deploymentType>cloudhub</deploymentType>
             <muleVersion>3.8.2</muleVersion>
             <username>username</username>
             <password>mypassword</password>
              <applicationName>myapplication-maven-1.0</applicationName>
              <!-- <businessGroup>engineering\devops</businessGroup> -->
             <target>CloudHub</target>
             <!-- One of: server, serverGroup, cluster -->
             <domain>${cloudhub.domain}</domain>
             <targetType>server</targetType>
             <environment>DEVELOPMENT</environment>
         </configuration>
         <executions>
             <execution>
                 <id>deploy</id>
                 <phase>deploy</phase>
                 <goals>
                     <goal>deploy</goal>
                 </goals>
             </execution>
         </executions>
     </plugin>
        <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-app-maven-plugin</artifactId>
                <version>${mule.tools.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <copyToAppsDirectory>true</copyToAppsDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/app/</directory>
                                </resource>
                                <resource>
                                    <directory>mappings/</directory>
                                </resource>
                            <resource>
                                    <directory>src/main/api/</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.mule.tools</groupId>
                <artifactId>maven-mule-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <excludeMuleDependencies>false</excludeMuleDependencies>
                    <inclusions>
                        <inclusion>
                            <groupId>org.mule.modules</groupId>
                            <artifactId>mule-module-objectstore</artifactId>
                        </inclusion>
                    </inclusions>
                </configuration>
            </plugin>
        <plugin>
                <groupId>com.mulesoft.munit.tools</groupId>
                <artifactId>munit-maven-plugin</artifactId>
                <version>${munit.version}</version>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <coverage>
                        <runCoverage>true</runCoverage>
                        <formats>
                            <format>html</format>
                        </formats>
                    </coverage>
                </configuration>
            </plugin>
        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/munit</directory>
            </testResource>
        <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
    </build>

    <!-- Mule Dependencies -->
    <dependencies>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-apikit</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>mule-munit-support</artifactId>
            <version>${mule.munit.support.version}</version>
            <scope>test</scope>
        </dependency>
    <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-runner</artifactId>
            <version>${munit.version}</version>
            <scope>test</scope>
        </dependency>
    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-objectstore</artifactId>
        <version>1.3.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.mule.modules/mule-module-spring-extras -->
    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-spring-extras</artifactId>
        <version>3.8.1</version>
    </dependency>

    </dependencies>

    <repositories>
          <repository>
            <id>Central</id>
            <name>Central</name>
            <url>http://repo1.maven.org/maven2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-release</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>http://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

Редактировать:

После добавления зависимости, как указано Dds, я обнаружил следующую ошибку: [ERROR] Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.2.1:test (test) on project myapplication: Execution test of goal com.mulesoft.munit.tools:munit-maven-plugin:1.2.1:test failed: org.mule.api.config.ConfigurationException: Configuration problem: Failed to import bean definitions from URL location [classpath:myapplication-get-id.xml] [ERROR] Offending resource: URL [file:/D:/RamG/Eclipses/Workspaces/Mule-Workspace-28thOct/myapplication/target/test-classes/myapplication-apikit-test.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [myapplication-get-id.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [com.mulesoft.weave.mule.config.WeaveNamespaceHandler] for namespace [http://www.mulesoft.org/schema/mule/ee/dw]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: scala/Option (org.mule.api.lifecycle.InitialisationException): scala.Option [ERROR] -> [Help 1] Когда я просматривал информацию, я вижу, что был опубликован еще один вопрос SO, но без ответа. Это относится к dataweave + scala / Option, что совпадает с ошибкой, которую я получаю.

По какой-то причине этот компонент dataweave не загружается полностью, в частности, не загружается файл jar. После некоторого упражнения я загрузил и скопировал в соответствующую папку .m2 вручную. Но после этого я вижу указанную выше ошибку. Таким образом, у него либо есть некоторые зависимости, которые не разрешаются, например, «scala / Option» !! Я не уверен.

Спасибо

Привет, такие ошибки при запуске из Maven обычно указывают на отсутствие зависимости в вашем файле pom.


person Gana    schedule 11.11.2016    source источник


Ответы (1)


Тот, который содержит потребителя веб-службы, должен быть:

Пожалуйста, добавьте его к себе и попробуйте. HTH

<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-module-ws</artifactId>
  <version>${mule.version}</version>
  <scope>provided</scope>
</dependency>

Это мне действительно помогло. Я отмечу как отвеченный. Проблема продолжилась с другой ошибкой:

<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-module-ws</artifactId>
  <version>${mule.version}</version>
  <scope>provided</scope>
</dependency>
. Можете ли вы сказать мне, к чему относится эта зависимость или проблема? Спасибо

person Dds    schedule 12.11.2016
comment
Это не похоже на отсутствующую зависимость, а скорее на проблему с тестовыми файлами конфигурации mule app / munit. Я действительно не имею представления только об этой трассировке стека. Я посоветую вам открыть другой вопрос и попытаться разобраться в проблеме. Возможно, вы загружаете приложение частично (при весеннем импорте) и чего-то не хватает - person Gana; 14.11.2016
comment
[ОШИБКА] Не удалось выполнить цель com.mulesoft.munit.tools:munit-maven-plugin:1.2.1:test (test) в проекте api-system-plm-material: проверка выполнения цели com.mulesoft.munit.tools : munit-maven-plugin: 1.2.1: ошибка теста: org.mule.api.config.ConfigurationException: строка 19 в XML-документе из URL-адреса [файл: / D: / Mule-Workspace-28thOct / myapplication / target / test- классы / myapplication_flow1.xml] недопустимы; вложенное исключение - org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 105; cvc-complex-type.2.4.a: обнаружен недопустимый контент, начиная с элемента ws: consumer-config. Один из '{"http://www.mulesoft.org/schema/mule/core ": аннотации," http://www.mulesoft.org/schema/mule/core ": описание," http://www.springframework.org/schema/beans ": beans", http://www.springframework.org/schema/beans ": bean," http://www.springframework.org/schema/context ": свойство-заполнитель, "http://www.springframework.org/schema/beans": ref, "http://www.mulesoft.org/schema/mule/core ": global-property , "http://www.mulesoft.org/schema/mule/core" : конфигурация, "http://www.mulesoft.org/schema/mule/core ": уведомления," http://www.mulesoft.org/schema/mule/core ": abstract-extension," http://www.mulesoft.org/schema/mule/core ": abstract-shared-extension," http://www.mulesoft.org/schema/mule/core ": abstract-mixed-content-extension," http://www.mulesoft.org/schema/mule/core": abstract-agent, "http://www.mulesoft.org/schema/mule/core ": abstract-security-manager," http://www.mulesoft.org/schema/mule/core ": abstract-transaction-manager," http://www.mulesoft.org/schema/mule/core ": abstract-shared-transaction-manager," http://www.mulesoft.org/schema/mule/core ": abstract-connector," http://www.mulesoft.org/schema/mule/core": abstract-shared-connector, "http://www.mulesoft.org/schema/mule/core": abstract-global-endpoint, "http://www.mulesoft.org/schema/mule/core": abstract-exception-strategy, "http://www.mulesoft.org/schema/mule/core": abstract-flow-construct, "http://www.mulesoft.org/schema/mule/core": flow, "http://www.mulesoft.org/schema/mule/core": подпоток "http://www.mulesoft.org/schema/mule/core ": абстрактная модель, "http://www.mulesoft.org/schema/mule/core": абстрактный-перехватчик-стек "http://www.mulesoft.org/schema/mule/core ": абстрактный-фильтр," http://www.mulesoft.org/schema/mule/core ": abstract-transformer," http://www.mulesoft.org/schema/mule/core": цепочка процессоров, "http://www.mulesoft.org/schema/mule/core": custom-processor, "http://www.mulesoft.org/schema/mule/core ": abst - person Dds; 14.11.2016