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

Ical4j 4.0.1 introduced duplicated classes #708

Open
johandorland opened this issue Jul 3, 2024 · 0 comments
Open

Ical4j 4.0.1 introduced duplicated classes #708

johandorland opened this issue Jul 3, 2024 · 0 comments

Comments

@johandorland
Copy link

Describe the bug
We use the Maven enforcer plugin to check our dependencies, of which ical4j is one.
With the update to 4.0.1 the enforcer plugin failed with the following message. It seems like ical4j itself is packaging duplicate classes.
This issue did not exist in 4.0.0, so it seems like it was introduced in 4.0.1.

[ERROR] Rule 0: org.codehaus.mojo.extraenforcer.dependencies.BanDuplicateClasses failed with message:
[ERROR] Duplicate classes found:
[ERROR] 
[ERROR]   Found in:
[ERROR]     org.mnode.ical4j:ical4j:jar:4.0.1:compile
[ERROR]   Duplicate classes:
[ERROR]     net/fortuna/ical4j/model/parameter/Display.class
[ERROR]     net/fortuna/ical4j/validate/PropertyRuleSet$1.class
[ERROR]     net/fortuna/ical4j/model/property/Categories.class
[ERROR]     net/fortuna/ical4j/model/property/TzUntil$Factory.class
[ERROR]     net/fortuna/ical4j/model/property/Summary.class
[ERROR]     net/fortuna/ical4j/model/property/immutable/ImmutableBusyType.class
[ERROR]     net/fortuna/ical4j/model/property/StreetAddress.class
.........

To Reproduce
Steps to reproduce the behavior:
I added a simplified maven pom.xml down below

  1. Create a maven project with ical4j and use the enforcer plugin
  2. Run mvn enforcer:enforce
  3. See error

When building the 4.0.1 tag of ical4j with ./gradlew clean build -x test, I see gradle is throwing the following warnings, which are not present in 4.0.0.

Encountered duplicate path "net/fortuna/ical4j/data/CalendarBuilder.class" during copy operation configured with DuplicatesStrategy.WARN
Encountered duplicate path "net/fortuna/ical4j/data/CalendarParser.class" during copy operation configured with DuplicatesStrategy.WARN
Encountered duplicate path "net/fortuna/ical4j/data/CalendarParserFactory.class" during copy operation configured with DuplicatesStrategy.WARN
Encountered duplicate path "net/fortuna/ical4j/data/CalendarParserImpl$ComponentListParser.class" during copy operation configured with DuplicatesStrategy.WARN
Encountered duplicate path "net/fortuna/ical4j/data/CalendarParserImpl$ComponentParser.class" during copy operation configured with DuplicatesStrategy.WARN

Expected behavior
I would expect ical4j to not package duplicate classes.

Environment (please complete the following information):

  • OS: Linux
  • Java Version: 17
  • iCal4j Version: 4.0.1

Additional context
Apparently the duplicates are perfect copies, because when the ignoreWhenIdentical option is enabled, it works.

<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany.app</groupId>
    <artifactId>my-app</artifactId>
    <version>1</version>

    <dependencies>
        <dependency>
            <groupId>org.mnode.ical4j</groupId>
            <artifactId>ical4j</artifactId>
            <version>4.0.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <rules>
                        <banDuplicateClasses>
                            <findAllDuplicates>true</findAllDuplicates>
                            <!-- <ignoreWhenIdentical>true</ignoreWhenIdentical> -->
                        </banDuplicateClasses>
                    </rules>
                    <fail>true</fail>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.8.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
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

No branches or pull requests

1 participant