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

CAMEL-21715: Fix test-jar dependencies #17071

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christophd
Copy link
Contributor

Description

  • Since we have been moving some classes in the test-infra-* modules from src/test/java to src/main/java we need to explicitly depend on both test-jar and normal typed dependencies
  • Maven will figure it out but IDEs such as IntelliJ raise compile errors
  • Explicitly add dependency to test-infra-* modules to avoid compile errors in IntelliJ due to test-jar typed dependencies

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Fixes CAMEL-21715

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

- Since we have been moving some classes in the test-infra-* modules from src/test/java to src/main/java we need to explicitly depend on both test-jar and normal typed dependencies
- Maven will figure it out but IDEs such as IntelliJ raise compile errors
- Explicitly add dependency to test-infra-* modules to avoid compile errors in IntelliJ due to test-jar typed dependencies
Copy link
Contributor

github-actions bot commented Feb 5, 2025

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus
Copy link
Contributor

so we need both test and test-jar dependencies ?

@christophd
Copy link
Contributor Author

yes, seems only a few classes have been moved from src/test/java to /src/main/java
@Croway maybe knows more

@christophd
Copy link
Contributor Author

this is only for IDEs like IntelliJ because Maven itself will figure out the transitive dependency when the test-jar is given in the POM as a dependency. IntelliJ complains with compile errors. I think this is because the IDE strictly separates test and main dependency tree

@Croway
Copy link
Contributor

Croway commented Feb 5, 2025

            <groupId>org.apache.camel</groupId>
            <artifactId>camel-test-infra-artemis</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>

The test jar one is enough since the following plugin https://github.com/apache/camel/blob/main/test-infra/pom.xml#L108 will assembly both test and main classes into the test-jar

@christophd
Copy link
Contributor Author

christophd commented Feb 5, 2025

@Croway ah was not ware of this. but why is IntelliJ showing those compile errors then? Is the assembly disabled when using the -Dquickly option?

@Croway
Copy link
Contributor

Croway commented Feb 5, 2025

this is only for IDEs like IntelliJ because Maven itself will figure out the transitive dependency when the test-jar is given in the POM as a dependency. IntelliJ complains with compile errors. I think this is because the IDE strictly separates test and main dependency tree

oh, this is strange, actually I didn't notice it in intellij

@Croway
Copy link
Contributor

Croway commented Feb 5, 2025

@Croway ah was not ware of this. but why is IntelliJ showing those compile errors then? I the assembly disabled when using the -Dquickly option?

no, it is not disabled with -Dquickly option

@christophd
Copy link
Contributor Author

am I the only one seeing the compile errors in the IDE? for instance when opening org.apache.camel.component.amqp.AMQPSAuthRouteTest

@Croway
Copy link
Contributor

Croway commented Feb 5, 2025

This is the only issue I see on the ide

image

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

Successfully merging this pull request may close these issues.

4 participants