question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add multiple folders to src path

See original GitHub issue

We are trying to make this work with a Bazel mono-repo and are wondering if there is a programmatic way to add multiple src folders to the .classpath file?

Right now it seems to add the first src/main/java folder if finds to the .classpath file and then stops. If you right-click on another folder and add it to the java source path that works fine.

For example:

<classpath>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="src" path="{default added folder 1}"/> 
        <classpathentry kind="src" path="{manually added folder 2}"/>
<classpath>

It would be nice to have a config like this:

  "java.project.srcs": [
    "/src/main/java",
    "/src/test/java"
  ]

For example, this shell script exports the desired src folders.

SRC_PATHS=$(find . -type d -path '*/src/main/java' -o -path '*/src/test/java')

Hopefully, there is another, simpler way to do this.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jdneocommented, Mar 9, 2021

The upstream issue has been fixed.

In the next version, you should be able to use the setting java.project.sourcePaths to specify your source paths for the project without any build tools

0reactions
no-response[bot]commented, Feb 1, 2021

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

creating multiple src directories in eclipse - java - Stack Overflow
Right-click your project, select Build Path and Configure Build Path. ... Do this by selecting a folder (to add folders to), like src/main ......
Read more >
[SOLVED] How to add multiple folders to your PATH ? [Archive]
Lo Guys , I want to add some folders to my PATH variable in my ~/.bashrc file. It was quite easy by adding...
Read more >
Maven Project with Multiple Source Directories | Baeldung
Configure multiple source directories in a Maven project. ... let's add a new source directory called another-src in the src/main folder.
Read more >
Multi-root Workspaces in Visual Studio Code
The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder. Add Root Folder. Once...
Read more >
Content roots | IntelliJ IDEA Documentation - JetBrains
Click Add Content Root and specify the folder that you want to add as a new content root. To remove a content root,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found