简体   繁体   中英

How to override the auto generated mule-artifact.json with mule extension

Is it possible to override the auto-generated mule-artifact.json when creating a custom mule extension?

Yes it can be overridden, you need to place your custom mule-artifact.json under META-INF/mule-artifact/mule-artifact.json inside your project's src/main/resources .

A work around for overriding the auto-generated mule-artifact.json is to add maven-resources-plugin to your pom and run it after the mule-extensions-maven-plugin creates the file. Here is what I used:

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-custom-artifact</id>
            <phase>process-classes</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${basedir}/target</outputDirectory>
                <resources>
                    <resource>
                        <directory>src/main/resources/META-INF/mule-artifact</directory>
                        <targetPath>classes/META-INF/mule-artifact</targetPath>
                    </resource>
                </resources>
                <overwrite>true</overwrite>
            </configuration>
        </execution>
    </executions>
</plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM