导入无法解决-

时间:2019-06-23 00:03:26

标签: java maven import

我明白了 导入com.digitalasset.quickstart.model.iou.Iou无法在我的main.java文件中解析。

但是,我编译了这些库,并且该类出现在我的目标文件中。

可能是什么原因?我应该在代码中对目录进行硬编码吗?

我该如何修复才能找到此导入文件?

这是我下面的pom:

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

    <groupId>quickstart</groupId>
    <artifactId>daml-quickstart-java</artifactId>
    <packaging>jar</packaging>
    <version>1.0.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <daml-codegen-java.output>${project.build.directory}/generated-sources/iou</daml-codegen-java.output>
        <ledgerhost>localhost</ledgerhost>
        <ledgerport>6865</ledgerport>
        <party>Alice</party>
        <restport>8080</restport>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.daml.ledger</groupId>
            <artifactId>bindings-rxjava</artifactId>
            <version>100.13.5</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-lite</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
        </dependency>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>2.7.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <dependencies>
                    <dependency>
                        <groupId>com.daml.java</groupId>
                        <artifactId>codegen</artifactId>
                        <version>100.13.5</version>
                        <type>jar</type>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>daml-codegen-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <includeProjectDependencies>false</includeProjectDependencies>
                            <includePluginDependencies>true</includePluginDependencies>
                            <mainClass>com.digitalasset.daml.lf.codegen.Main</mainClass>
                            <arguments>
                                <argument>-o</argument>
                                <argument>${daml-codegen-java.output}</argument>
                                <argument>-d</argument>
                                <argument>com.digitalasset.quickstart.iou.TemplateDecoder</argument>
                                <argument>${project.build.directory}/daml/iou.dar=com.digitalasset.quickstart.model</argument>
                            </arguments>
                            <sourceRoot>${daml-codegen-java.output}</sourceRoot>
                        </configuration>
                    </execution>
                    <execution>
                        <id>run-quickstart</id>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>com.digitalasset.quickstart.iou.IouMain</mainClass>
                            <arguments>
                                <argument>${ledgerhost}</argument>
                                <argument>${ledgerport}</argument>
                                <argument>${party}</argument>
                                <argument>${restport}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

0 个答案:

没有答案
相关问题