Switching to Maven from GNUMake

I have been using Make build for a long time, but I decided to start studying the Maven build system. Although I read most of the online docs, none of them give me the analogies I'm looking for. I understand the system life cycle, but I don’t see a link to compile step dependencies. For example, I want to generate a JFlex grammar as part of the compilation life cycle stage. At present, I do not see the possibility of making this step a preliminary step. The documentation seems to be limited to this. In general, the concept of step dependencies seems to be baked into Maven and requires a plugin for any changes. This is true? Which is missing me, because currently the Maven build system seems very limited in how you can configure the compilation steps.

+5
source share
2 answers

You can do something in Maven. Usually it has a default method for each thing, and then you can intercept and redefine it if you want to do something special. Sometimes it takes a lot and scratches on the head to figure it out.

There is even an official JFlex Maven plugin .

If possible, find someone who made the Maven plugin to do what you want. Even if he is not 100% right, he can at least give you an idea of ​​how to make maven something.

Minimum configuration

Java- (.jflex, *.jlex, *.lex,.flex), src/main/jflex/ . Java - , . Java target/ /jflex , Java- . pom.xml

<project>
  <!-- ... -->
  <build>
    <plugins>
      <plugin>
        <groupId>de.jflex</groupId>
        <artifactId>jflex-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <!-- ... -->
  </build>
  <!-- ... -->
</project>

maven -. (src/main/flex), . , . Maven , .

+4

, , ant, maven, .

0

All Articles