R. Gault
R. Gault

Reputation: 72

Maven build fails inside IntelliJ and on command line

I have searched high and low to find a resolution for this and I am stumped.

I'm trying to build from the google-cloud-dataflow-java-sdk-all archetype and continue to get the same error within IntelliJ and using mvn install using POM on command line. Also get the same error using mvn archetype:generate ... from command line.

Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli)
on project standalone-pom: The defined artifact is not an archetype -> [Help 1]

Hoping somebody else has seen this.

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>
 
  <parent>
    <groupId>com.google.cloud.dataflow</groupId>
    <artifactId>google-cloud-dataflow-java-sdk-parent</artifactId>
    <version>2.0.0</version>
  </parent>
 
  <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
  <name>Google Cloud Dataflow SDK for Java - All</name>
  <description>Google Cloud Dataflow SDK for Java is a distribution of Apache
      Beam designed to simplify usage of Apache Beam on Google Cloud Dataflow
      service. This artifact includes entire Dataflow Java SDK.</description>
 
  <packaging>jar</packaging>
 
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>
 
  <dependencies>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-core</artifactId>
    </dependency>
 
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
    </dependency>
 
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-direct-java</artifactId>
    </dependency>
 
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
    </dependency>
  </dependencies>
</project>

mvn generate:archetype command:

mvn archetype:generate \
-DarchetypeArtifactId=google-cloud-dataflow-java-sdk-all \
-DarchetypeGroupId=com.google.cloud.dataflow \
-DarchetypeVersion=2.0.0 \
-DgroupId=com.rgault.google \
-DartifactId=dataflow \
-DinteractiveMode=false \
-Dpackage=com.rgault.google \
-Dversion=0.1

Upvotes: 1

Views: 444

Answers (1)

Morfic
Morfic

Reputation: 15508

You're trying to use an archetype which is not actually one, but an all-in-one dependency bundle:

Google Cloud Dataflow SDK For Java All » 2.0.0

Google Cloud Dataflow SDK for Java is a distribution of Apache Beam designed to simplify usage of Apache Beam on Google Cloud Dataflow service. This artifact includes entire Dataflow Java SDK.


As per these docs, the correct archetype id is google-cloud-dataflow-java-archetypes-examples:

Create a Maven Project that contains the Cloud Dataflow SDK for Java and Examples

  1. Create a Maven project containing the Cloud Dataflow SDK for Java using the Maven Archetype Plugin. Run the mvn archetype:generate command in your shell or terminal as follows:

    JAVA: SDK 1.X

        mvn archetype:generate \
        -DarchetypeArtifactId=google-cloud-dataflow-java-archetypes-examples \
        -DarchetypeGroupId=com.google.cloud.dataflow \
        -DarchetypeVersion=1.9.0 \
        -DgroupId=com.example \
        -DartifactId=first-dataflow \
        -Dversion="0.1" \
        -DinteractiveMode=false \
        -Dpackage=com.example

    JAVA: SDK 2.X

        mvn archetype:generate \
        -DarchetypeArtifactId=google-cloud-dataflow-java-archetypes-examples \
        -DarchetypeGroupId=com.google.cloud.dataflow \
        -DarchetypeVersion=2.0.0 \
        -DgroupId=com.example \
        -DartifactId=first-dataflow \
        -Dversion="0.1" \
        -DinteractiveMode=false \
        -Dpackage=com.example

Upvotes: 2

Related Questions