1

私は Apache Tomee 7.0.2 マイクロプロファイルで遊んでいて、マイクロサービスについてもっと学ぼうとしています。チュートリアル リンクの 1 つがhttps://www.javacodegeeks.com/2017/03/microservices-series-microprofile-apache-tomee.htmlにあります。

上記のリンクのサンプルを使用すると、Maven パッケージ フェーズで次のエラーが発生します。

[INFO] --- tomee-maven-plugin:7.0.1:exec (default-cli) @ Microservice ---    
[INFO] TomEE was unzipped in '/home/yapkm01/Java/jakartaEE/Workspace/Microservices/target/apache-tomee'
[INFO] Removed not mandatory default webapps
[WARNING] '/home/yapkm01/Java/jakartaEE/Workspace/Microservices/target/tomeeweb.jar' doesn't exist, ignoring (maybe run mvn package before this plugin)
[INFO] Zipping Custom TomEE Distribution
[INFO] TomEE will run in development mode
[INFO] Attaching Exec TomEE binary
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.644 s
[INFO] Finished at: 2019-09-15T16:13:58-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomee.maven:tomee-maven-plugin:7.0.1:exec (default-cli) on project Microservice: Execution default-cli of goal org.apache.tomee.maven:tomee-maven-plugin:7.0.1:exec failed: For artifact {io.microservices.tutorial:Microservice:0.0.1-SNAPSHOT:jar}: An attached artifact must have a different ID than its corresponding main artifact. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] h

エラーメッセージがよくわかりません:

[ERROR] Failed to execute goal org.apache.tomee.maven:tomee-maven-plugin:7.0.1:exec (default-cli) on project Microservice: Execution default-cli of goal org.apache.tomee.maven:tomee-maven-plugin:7.0.1:exec failed: For artifact {io.microservices.tutorial:Microservice:0.0.1-SNAPSHOT:jar}: An attached artifact must have a different ID than its corresponding main artifact. -> [Help 1]

ここに pom.xml があります。

<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>io.microservices.tutorial</groupId>
<artifactId>Microservice</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
    <java.version>1.10</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.tomee</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.7</version>
    </dependency>
</dependencies>

<build>
    <finalName>tomeeweb</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.tomee.maven</groupId>
            <artifactId>tomee-maven-plugin</artifactId>
            <version>7.0.1</version>
            <configuration>
                <tomeeClassifier>webprofile</tomeeClassifier>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

ここで何か助けていただければ幸いです。
ありがとう。

4

1 に答える 1