Skip to content

Add guidance to exclude Build and Cache Intel directories from Apache… #10969

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,48 @@ This is currently supported with Gradle build tool only .
![Build Intelligence Savings](./static/build-intelligence-savings.png)

Visit [Intelligence Savings](/docs/continuous-integration/use-ci/harness-ci-intelligence#intelligence-savings) for more information.

### Troubleshooting

#### Ignoring Build and Cache Intel Directories in Apache RAT Scans

If you are using the Apache RAT plugin for license compliance, it may incorrectly mark Harness Build Intelligence or Cache Intelligence directories as invalid files. This can cause unnecessary failures in your build pipeline.

To avoid this, explicitly exclude the following directories in your pom.xml file.

**Directories to Ignore**
- Build Intelligence:
`/harness/.mvn`

- Cache Intelligence:
`/harness/.m2`
`/harness/.mvn` (also applies to cache-related scans)

**Example: Update to pom.xml**
Add the following snippet under the `<build>` section to configure the apache-rat-plugin to ignore these paths:

```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.15</version> <!-- Or use the latest version -->
<configuration>
<excludes>
<exclude>/harness/.mvn</exclude>
<exclude>/harness/.m2</exclude> <!-- Optional, but recommended -->
</excludes>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```
47 changes: 46 additions & 1 deletion docs/continuous-integration/use-ci/run-tests/tests-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,52 @@ config:

## Troubleshoot Test Intelligence

Go to the [CI Knowledge Base](/kb/continuous-integration/continuous-integration-faqs) for questions and issues related to Test Intelligence, including:
### Troubleshooting

#### Ignoring Build and Cache Intel Directories in Apache RAT Scans

If you are using the Apache RAT plugin for license compliance, it may incorrectly mark Harness Build Intelligence or Cache Intelligence directories as invalid files. This can cause unnecessary failures in your build pipeline.

To avoid this, explicitly exclude the following directories in your pom.xml file.

**Directories to Ignore**
- Build Intelligence:
`/harness/.mvn`

- Cache Intelligence:
`/harness/.m2`
`/harness/.mvn` (also applies to cache-related scans)

**Example: Update to pom.xml**
Add the following snippet under the `<build>` section to configure the apache-rat-plugin to ignore these paths:

```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.15</version> <!-- Or use the latest version -->
<configuration>
<excludes>
<exclude>/harness/.mvn</exclude>
<exclude>/harness/.m2</exclude> <!-- Optional, but recommended -->
</excludes>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```

Go to the [CI Knowledge Base](/kb/continuous-integration/continuous-integration-faqs) for more questions and issues related to Test Intelligence, including:

* [Does Test Intelligence split tests? Can I use parallelism with Test Intelligence?](/kb/continuous-integration/continuous-integration-faqs/#does-test-intelligence-split-tests-why-would-i-use-test-splitting-with-test-intelligence)
* [Test Intelligence call graph is empty.](/kb/continuous-integration/continuous-integration-faqs/#on-the-tests-tab-the-test-intelligence-call-graph-is-empty-and-says-no-call-graph-is-created-when-all-tests-are-run)
Expand Down