I created an empty maven project and it created a folder structure src/main/java
.
Now I want to link source from my local repo to this src/main/java
.
If I go to buildpath->link source
, and name the folder as src/main/java
, I get the
folder already exists error
If I delete the folder and then do the same step, I get following error.
What is the best way to go forward?
I cannot change the project structure in the repo location and copying the folder to my workspace would mean manually merging changes later.
EDIT Folder Structure:
And build part of my pom.xml:
<build>
<sourceDirectory>java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<excludes>
<exclude>**/old/**/*.java</exclude>
</excludes>
<includes>
<include>java/com/**/*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<excludes>
<exclude>**/old/**/*.java</exclude>
</excludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.start.Start</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>