简体   繁体   English

Akka缺少配置属性Akka.Version Akka.Stream

[英]Akka missing Config Properties Akka.Version Akka.Stream

Packaging Akka application. 包装Akka应用程序。

Hi I am trying to package my application into an executable Jar . 嗨,我正在尝试将我的应用程序打包到可执行的Jar Below is my Pom.xml 以下是我的Pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.personalProjects</groupId>
    <artifactId>MyAkkaProject</artifactId>
    <version>1.0</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>allinone</shadedClassifierName>
                            <artifactSet>
                                <includes>
                                    <include>*:*</include>
                                </includes>
                            </artifactSet>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>reference.conf</resource>
                                </transformer>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Main-Class>akka.Main</Main-Class>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-stream_2.12</artifactId>
            <version>2.5.18</version>
        </dependency>
        <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-stream-kafka_2.12</artifactId>
            <version>1.0-M1</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.1</version>
        </dependency>

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver</artifactId>
            <version>3.4.3</version>
        </dependency>

    </dependencies>

</project>

I can't seem to get the Jar to work, it states missing akka.streams config. 我似乎无法使Jar正常工作,它指出缺少akka.streams配置。

I went through the official doc here but it doesn't seem to work. 我在这里浏览了官方文档但似乎没有用。

If I copy all Jar to output directory everything works just fine but the issue seems to be when I try to create a big fat jar with all the dependencies in it. 如果我将所有Jar复制到输出目录,则一切正常,但问题似乎出在我尝试创建一个包含所有依赖项的big fat jar时。

my MANIFEST.INF is below: 我的MANIFEST.INF如下:

Manifest-Version: 1.0
Main-Class: MyAkkaProject.App

where App is the class with psvm and MyAkkaProject` is the package name 其中Apppsvm的类,而MyAkkaProject`是软件包的名称

/ targer目录

我解决了问题,当我运行他的项目甚至构建它时,问题就是我的IDE ,它没有使用Maven Lifecycle命令,因此未触发该插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM