错误sparkjava部署在heroku上

时间:2017-12-13 23:24:16

标签: heroku spark-java

在heroku的官方教程中部署基本的sparkjava webapp时面临这样的错误:

"无法在项目myapp上执行目标com.heroku.sdk:heroku-maven-plugin:0.4.4:deploy(default-cli):目标com.heroku.sdk的执行default-cli:heroku -maven-plugin:0.4.4:部署失败:执行com.heroku.sdk时缺少必需的类:heroku-maven-plugin:0.4.4:deploy:sun / misc / ** BASE64Encoder **"

我尝试多次重建项目,但总是失败。

它可能与JDK版本9或某些maven配置问题有关吗?提前Ty,抱歉非结构化错误样本。

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.example.app</groupId>
    <artifactId>myapp</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>2.7.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <descriptorRefs>

                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.heroku.sdk</groupId>
                <artifactId>heroku-maven-plugin</artifactId>
                <version>0.4.4</version>
                <configuration>
                    <jdkVersion>1.8</jdkVersion>
                    <appName>spark-application</appName>
                    <processTypes>

                        <web>java -jar ./target/myapp-1.0-jar-with-dependencies.jar</web>
                    </processTypes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:1)

问题非常愚蠢:maven-heroku-plugin的版本已经过时,在修改源文件夹并找到2个版本(0.4.4和1.3.3)之后我只是将版本更改为1.3.3并且一切工作正常。

答案 1 :(得分:1)

我为2.0.3更改de maven插件版本

<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>2.0.3</version>