无法将替换解析为值:$ akka.stream-blocking io dispatcher

时间:2018-04-11 07:49:54

标签: java maven akka maven-assembly-plugin

我是akka的新手,请帮助我。 在运行可执行jar时,我收到错误:无法将替换解析为值:$ akka.stream-blocking io dispatcher

This is my reference.conf

This is the error on running executable jar created after mvn assembly:single

2 个答案:

答案 0 :(得分:4)

reference.conf and your application.conf are merged,为了方便起见,您需要告诉maven附加reference.conf以便解决所有替换。

如果你正在使用maven-shade-plugin,那么你的POM should be configured like so reference.conf附加了AppendingTransformer

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>

                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>reference.conf</resource>
                </transformer>

              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>

如果您正在使用maven-assembly-plugin,那么see this related question

答案 1 :(得分:1)

确保程序集将各种reference.conf合并在一起,而不是只保留一个。

作为旁注,请不要在reference.conf中添加您自己的配置,而是按照here所述使用application.conf