eureka19
eureka19

Reputation: 3060

How is .classpath file in eclipse generated?

I've a java project in the eclipse which has a .classpath file as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/generated/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
.......
<classpathentry kind="output" path="target/classes"/>

How does this file gets generated? Can I edit this file?

I want a certificate file to be added to the project in path target/test-classes. Where do I configure that? My understanding is the target/test-classes folder gets generated after the mvn clean install. So I think there should be some place where I can configure what all I need in the target folder. Do I need to configure it in pom.xml ?

Upvotes: 2

Views: 16006

Answers (1)

GhostCat
GhostCat

Reputation: 140427

The .classpath file reflects the content of all the settings that you apply manually to your BUILD PATH setup within your project.

In other words: while using the eclipse UI to setup the BUILD PATH, all that information goes into the .classpath file.

And it is perfectly possible to stop eclipse and make changes to that file within your preferred editor; then restart eclipse, probably do a full refresh; and (unless you messed up) the changes should be visible when opening your BUILD PATH settings again.

Upvotes: 4

Related Questions