Using maven2 to build autotools-based C/C++ package

孤人 提交于 2019-12-04 14:42:45

I don't really know autotools, but can't you use the maven exec plugin, that lets you execute system commands (or Java programs)? For example:

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>exec-maven-plugin</artifactId>
      <executions>
        <execution>
          <id>exec-one</id>
          <phase>compile</phase>
          <configuration>
            <executable>autogen</executable>
            <arguments>
              <argument>-v</argument>
            </arguments>
          </configuration>
          <goals>
            <goal>exec</goal>
          </goals>
        </execution>

        <execution>
          <id>exec-two</id>
          <phase>compile</phase>
          <configuration>
            <executable>automake</executable>
            <arguments>
              <argument>-v</argument>
              <argument>[other arguments]</argument>
            </arguments>
          </configuration>
          <goals>
            <goal>exec</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

I didn't test the pom fragment above, but it gives you some hints about how to proceed.

You did overlook the maven cbuild parent suite. take a look at the "make-maven-plugin" section for more details.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!