[ 
https://issues.apache.org/jira/browse/BEAM-12597?focusedWorklogId=621858&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-621858
 ]

ASF GitHub Bot logged work on BEAM-12597:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/21 07:37
            Start Date: 13/Jul/21 07:37
    Worklog Time Spent: 10m 
      Work Description: je-ik commented on a change in pull request #15159:
URL: https://github.com/apache/beam/pull/15159#discussion_r668504324



##########
File path: 
sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/pom.xml
##########
@@ -132,6 +132,9 @@
               </filters>
               <transformers>
                 <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+                  <resource>reference.conf</resource>

Review comment:
       Flink uses [akka](https://akka.io/), which in turn uses [typesafe 
config](https://github.com/lightbend/config) for configuration. The typesafe 
config uses two types of configuration files - `reference.conf` and 
`application.conf`, where the first holds defaults which the latter can 
(optionally) override. Both these files are located in resources of respective 
jar (library). Akka has several modules, each of which has its own 
`reference.conf`, which is fine as long as each of these jars is on classpath. 
When we shade them together, we must append the respective `reference.conf`s so 
that each (sub)module has its default values.
   
   
https://doc.akka.io/docs/akka/current/additional/packaging.html#maven-jarjar-onejar-or-assembly




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 621858)
    Time Spent: 50m  (was: 40m)

> Use AppendingTransformer for reference.conf in archetype poms
> -------------------------------------------------------------
>
>                 Key: BEAM-12597
>                 URL: https://issues.apache.org/jira/browse/BEAM-12597
>             Project: Beam
>          Issue Type: Improvement
>          Components: examples-java
>    Affects Versions: 2.31.0
>            Reporter: Jan Lukavský
>            Assignee: Jan Lukavský
>            Priority: P2
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The archetype pom.xml, does not include AppendingTransformer in shade plugin, 
> which results in reference.conf being overwritten during build by files in 
> different modules (akka, flink). This results in error when trying to run 
> examples locally.
> {code}
>  java -cp target/word-count-beam-bundled-0.1.jar 
> org.apache.beam.examples.WordCount --inputFile=/tmp/input 
> --output=/tmp/output --runner=testflinkrunner
> ...
> Exception in thread "main" 
> org.apache.beam.sdk.Pipeline$PipelineExecutionException: 
> com.typesafe.config.ConfigException$UnresolvedSubstitution: reference.conf @ 
> jar:file:/tmp/beam/word-count-beam/target/word-count-beam-bundled-0.1.jar!/reference.conf:
>  875: Could not resolve substitution to a value: ${akka.stream.materializer}
>  at org.apache.beam.runners.flink.TestFlinkRunner.run(TestFlinkRunner.java:75)
>  at org.apache.beam.sdk.Pipeline.run(Pipeline.java:323)
>  at org.apache.beam.sdk.Pipeline.run(Pipeline.java:309)
>  at org.apache.beam.examples.WordCount.runWordCount(WordCount.java:185)
>  at org.apache.beam.examples.WordCount.main(WordCount.java:192)
> Caused by: com.typesafe.config.ConfigException$UnresolvedSubstitution: 
> reference.conf @ 
> jar:file:/tmp/beam/word-count-beam/target/word-count-beam-bundled-0.1.jar!/reference.conf:
>  875: Could not resolve substitution to a value: ${akka.stream.materializer}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to