logo

Renaming WSO2 Carbon Archive with Maven

By default, maven based projects will use the artifact id and the version number as the name of the final artifact (jar file, war file, etc.). In case if we want to change that behavior, there is a standard way defined by maven to specify a different name to the final artifact. You just need to add the finalName element to build section.

<project ... >
  ...
  <build>
    ...
    <finalName>Custom_Name</finalName>
    ...
  </build>
</project>

But when it comes to WSO2 Carbon application, you can’t you this method to rename the .car file. The car plugin using the configuration element to pick the custom name. So you have to define your custom final name as follows.

<project ...>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.wso2.maven</groupId>
        <artifactId>maven-car-plugin</artifactId>
        ...
        <configuration>
          <finalName>Custom_Name</finalName>
        </configuration>
      </plugin>
      ...
    </plugins>
  </build>
</project>

 

Comments are closed.