My test project has multiple source directories when only one source set is defined. I wasn’t expecting my build to compile 2 (PathTest, PathTest2) classes. Only one called ‘PathTest’
There is on module. This is the directory structure.
It’s very likely that something in your build script(s) is causing this (e.g. a parent script or an init script). Can you provide a reproducible sample?
This sample project is as simple as it gets. 3 files, two of which are java source files and the third is the gradle.build file. I will provide the remaining 2 java files that I have demonstrated in this thread.
PathTest.java
package org.jboss.performance.test;
public class PathTest
{
public PathTest()
{
}
public static void main (String[] args)
{
System.out.println("Testing testing first path.");
}
}
PathTest2.java
package org.jboss.performance.path;
public class PathTest2
{
public PathTest2()
{
}
public static void main (String[] args)
{
System.out.println("Testing testing second path.");
}
}
You now have all the files in the project and the project directory structure. If you need anything else I will provide it.
No need for you to further investigate this issue. I have been trying different combinations and found the reason for my original query. Your penultimate reply with details of the default src/main/java being added explains why I see both classes. When using this gradle.build (different to the initial sample)