If you have an erlang-otp artifact referenced as a dependency with in a POM, the artifact is unpacked (as expected) in ./target/lib. However, this code path is not visible to erlc during the erlang:compile phase. Where this is particularly problematic is in regard to -include/-include_lib declarations that depend on emitting the erlc command with the proper -I directive (in this case, -Itarget/lib). The proposed fix is to make -Itarget/lib a default.
Furthermore, the documentation for erlang:compile indicates that <erlcOptions> may be used to add additional parameters to the compiler. However, if you attempt to add something like <erlcOptions>-Itarget/lib</erlcOptions>, the plugin will bail out because it doesn't like the token. Parsing the maven-erlang-plugin source code, it seems like the token is supposed to be <compilerOptions>. However, setting this option fixes the parse error, but does not take effect on the erlang:compile phase as evident from the following output from a run of "mvn package -X"
[DEBUG] Executing [erlc, -I, /home/ghaskins/sandbox/git/gwtclient/example-server/target/include, -I, /home/ghaskins/sandbox/git/gwtclient/example-server/src/main/erlang, -o, /home/ghaskins/sandbox/git/gwtclient/example-server/target/ebin, +report_errors, +report_warnings, /home/ghaskins/sandbox/git/gwtclient/example-server/src/main/erlang/example_app.erl, /home/ghaskins/sandbox/git/gwtclient/example-server/src/main/erlang/example_server.erl, /home/ghaskins/sandbox/git/gwtclient/example-server/src/main/erlang/example_sup.erl]
Log in to post a comment.