私は ANTLR4 が初めてで、v4 用の Eclipse プラグインがないようです。したがって、.g4 文法から Java ソースを自動的に構築するとよいでしょう。src/main/java、src/test/java を使用した単純な空の Maven プロジェクトがあります。.g4 ファイルをどこに配置しますか? Maven で文法を自動的に構築するにはどうすればよいですか?
私自身のPOMテストが失敗しました:
<repository>
<id>mvn-public</id>
<name>MVNRepository</name>
<url>http://mvnrepository.com</url>
</repository>
...
<build>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<goals>
<goal>antlr</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
エクリプス 言います:
Failure to find org.antlr:antlr4-maven-plugin:pom:4.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of
central has elapsed or updates are forced