[ 
https://issues.apache.org/jira/browse/MNG-6658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16888476#comment-16888476
 ] 

Caleb commented on MNG-6658:
----------------------------

Hi, although I appreciate there is a proper way of doing things in maven, there 
are times when it can't be helped. We are working on a legacy app originally 
built to work in ant. The file system structure is a mess. It certainly isn't 
structured the "maven way". Unfortunately there is a lot of active development 
going on, so it's not possible to simply rework the entire structure of the 
project to suit the maven way right at the moment. This means we have created a 
maven folder structure on the side which consists of only pom files and makes 
use of custom folder locations to find all the correct files. It currently 
works in maven 3.5. Today a developer with a new machine tried it with maven 
3.6 and it broke with the exact error mentioned above.

Although I appreciate there is a maven way and we should adhere to it where 
possible (and migrate toward it when the project permits), for integration with 
legacy apps I think it is appropriate for maven to be able to cope with having 
non-custom source directories. Please reconsider opening this issue.

Thanks.

 

> Maven 3.6.1 breaks build when using custom source folder
> --------------------------------------------------------
>
>                 Key: MNG-6658
>                 URL: https://issues.apache.org/jira/browse/MNG-6658
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.6.1
>            Reporter: Gary McWilliams
>            Priority: Major
>
> NOTE: apacher 3.5.x and 3.6.0 don't exhibit this behaviour, only 3.6.1
> For reasons too long (and painful) to discuss, I have a need to build 2 war 
> files from one codebase.
> What I have:
> {{parent/}}
> {{  src/com/.../*.java}}
> {{  pom.xml}}
> {{  module1/}}
> {{    pom.xml}}
> {{  module2/}}
> {{    pom.xml}}
>  
> The parent folder (pom.xml with packaging 'pom') contains all the source and 
> defines the 2 modules.
> The parent pom.xml has:
> {{    <build>}}
>   {{       <sourceDirectory>../src/main/java</sourceDirectory>}}
>   {{       <testSourceDirectory>../src/test/java</testSourceDirectory>}}
>  
> When the 2 modules run, they find the source/test code in the parent folder 
> and compile/build out the class/war locally in target folder.
> Until 3.6.1, now I get:
> {{[ERROR] COMPILATION ERROR :}}
>  {{[INFO] -------------------------------------------------------------}}
>  {{[ERROR] /D:/.../src/main/java/com/.../ClassA.java:[36,8] duplicate class: 
> com....ClassA}}
> where the "duplcate" classname is "the same class", so ClassA complains about 
> duplicate ClassA
> Using maven 3.5.2, I see:
> {{[INFO] Compiling 11 source files to ...}}
> In maven 3.6.1, I see:
> {{[INFO] Compiling 22 source filesto ...}}
> Just looking advice. I know I should not be trying to build 2 artifacts in 
> one project, but it's been working until now
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to