Search code examples
javamavenakkamaven-assembly-plugin

Could not resolve substitution to value :$akka.stream-blocking io dispatcher


I am new to akka,kindly help me with this. On running the executable jar, I get the error:Could not resolve substitution to value :$akka.stream-blocking io dispatcher

This is my reference.conf

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


Solution

  • The reference.conf and your application.conf are merged, and to facilitate this, you need to tell maven to append the reference.conf so that all of it's substitutions are resolved.

    If you're using maven-shade-plugin, then your POM should be configured like so such that reference.conf is being appended by the 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>
    

    If you're using maven-assembly-plugin, then see this related question.