redhat-developer / redhat-developer/vscode-java

Auto build will delete test resources in UT

Open
#3,517 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

[provide a description of the issue]

Environment
  • Operating System:Windows11
  • JDK version:17
  • Visual Studio Code version:1.87.0
  • Java extension version:v1.28.1
Steps To Reproduce
  1. have a maven project like this
    src/main/java
    a.java
    src/main/resources
    test.json
    src/test/java
    aTest.java
    src/test/resources
    test.csv
  2. After run Java: Rebuild Project, I found that test.csv is copied to the target, but deteled in a while.
    So I run test in the aTest.java, I got a message that test.csv is not found.
  3. If I turn off auto build, success.

Is it possible that auto build cleaned the resources?

pom.xml

<resources>
	<resource>
		<directory>src/main/resources</directory>
		<filtering>true</filtering>
	</resource>
</resources>
<plugins>
	<plugin>
		<artifactId>maven-resources-plugin</artifactId>
		<executions>
			<execution>
				<phase>process-resources</phase>
				<goals>
					<goal>resources</goal>
				</goals>
			</execution>
		</executions>
	</plugin>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Maven configuration in pom.xml and reproduce the issue using Java: Rebuild Project with auto build enabled. Compare src/test/resources/test.csv with the target output and run aTest.java; done means the test resource remains available and the test succeeds after rebuilding.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.