Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven build fails with Cycle detected when quarkus-openshift dependency is included #145

Closed
sutaakar opened this issue Nov 5, 2021 · 2 comments · Fixed by #147
Closed
Assignees

Comments

@sutaakar
Copy link

sutaakar commented Nov 5, 2021

When both quarkus-operator-sdk-csv-generator and quarkus-openshift artifacts are included as dependencies for Maven build then quarkus-maven-plugin fails on build goal with io.quarkus.builder.ChainBuildException: Cycle detected.

Complete error:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.4.1.Final:build (default-cli) on project test: Failed to build quarkus application: io.quarkus.builder.ChainBuildException: Cycle detected:
[ERROR] 		   io.quarkus.deployment.pkg.steps.JarResultBuildStep#buildRunnerJar produced class io.quarkus.deployment.pkg.builditem.JarBuildItem
[ERROR] 		to io.quarkus.container.image.openshift.deployment.OpenshiftProcessor#openshiftRequirementsJvm produced class io.quarkus.kubernetes.spi.DecoratorBuildItem
[ERROR] 		to io.quarkus.kubernetes.deployment.KubernetesProcessor#build produced class io.quarkus.kubernetes.spi.GeneratedKubernetesResourceBuildItem
[ERROR] 		to io.quarkiverse.operatorsdk.csv.deployment.CSVProcessor#generateCSV produced class io.quarkus.deployment.builditem.FeatureBuildItem
[ERROR] 		to io.quarkus.deployment.steps.MainClassBuildStep#build produced class io.quarkus.deployment.builditem.GeneratedClassBuildItem
[ERROR] 		to io.quarkus.deployment.pkg.steps.JarResultBuildStep#buildRunnerJar

Reproducer:

  • Create pom.xml with this content:
<?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.test</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-bom</artifactId>
        <version>2.4.1.Final</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.quarkiverse.operatorsdk</groupId>
      <artifactId>quarkus-operator-sdk-csv-generator</artifactId>
      <version>2.0.0</version>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-openshift</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
  • Run mvn quarkus:build
@metacosm
Copy link
Member

metacosm commented Nov 8, 2021

Can you give #147 a try? I think that should address the issue.

@sutaakar
Copy link
Author

@metacosm Yes, it fixes the issue, thanks.

metacosm added a commit that referenced this issue Nov 11, 2021
* fix: break build cycle by not producing a FeatureBuildItem
* fix: explicitly use jib for container image to resolve ambiguity
* feat: generate CSV using GeneratedFileSystemResourceBuildItem

Fixes #145
metacosm added a commit that referenced this issue Nov 28, 2021
* fix: break build cycle by not producing a FeatureBuildItem
* fix: explicitly use jib for container image to resolve ambiguity
* feat: generate CSV using GeneratedFileSystemResourceBuildItem

Fixes #145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants