Skip to content

Maven recipes do not work when having dependencies of type "ejb" #5965

@maikebertpsc

Description

@maikebertpsc

What version of OpenRewrite are you using?

I am using

  • OpenRewrite 3.12.1
  • Maven plugin 6.16.0

How are you running OpenRewrite?

I am using the Maven plugin, and I run it on a Jakarta Enterprise code base.

What is the smallest, simplest way to reproduce the problem?

Have a Maven project with a dependency of type "ejb", e.g.

		<dependency>
			<groupId>com.psc.jobs</groupId>
			<artifactId>jobs-configuration</artifactId>
			<version>2.33.0</version>
			<type>ejb</type>
		</dependency>

Maven dependencies with type "ejb" are used to reference Enterprise JavaBeans (EJB) components in Java EE applications.

What did you expect to see?

When using recipes like

  • org.openrewrite.maven.UpgradeDependencyVersion or
  • org.openrewrite.maven.ExcludeDependency

I expect them to work on dependencies on type "ejb" as for the default type "jar".

What did you see instead?

The Maven pom was not modified as expected.
For example, versions are not getting updates nor exclusions added.

Additional infos

I assume the root cause is here:

if (d.getVersion() == null || (d.getType() != null && (!"jar".equals(d.getType()) && !"pom".equals(d.getType()) && !"zip".equals(d.getType()) && !"bom".equals(d.getType()) && !"tgz".equals(d.getType())))) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions