[
https://jira.codehaus.org/browse/MCOMPILER-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=342993#comment-342993
]
Ion Iovu commented on MCOMPILER-222:
------------------------------------
Hi Karl Heinz.
I did run mvn clean package locally.
Below is the resulting directory structure. Maven does not fail and notify that
the path of MyClass.java does not correspond with the package declaration
within. The expected result as described above is that maven fail in that case.
.
??? pom.xml
??? src
? ??? main
? ??? java
? ??? org
? ??? MyClass.java
??? target
??? classes
??? com
??? mycompany
??? mavenproject
??? MyClass.class
> plugin should fail if class package doesn't correspond to parent folder
> structure starting with src/main/java
> -------------------------------------------------------------------------------------------------------------
>
> Key: MCOMPILER-222
> URL: https://jira.codehaus.org/browse/MCOMPILER-222
> Project: Maven Compiler Plugin
> Issue Type: Bug
> Affects Versions: 3.1
> Environment: Apache Maven 3.1.1
> (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
> Maven home: /usr/local/Cellar/maven/3.1.1/libexec
> Java version: 1.7.0_60-ea, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.9.1", arch: "x86_64", family: "mac"
> Reporter: Ion Iovu
> Attachments: sampleProject.zip
>
>
> Having a class com.mycompany.myproject.MyClass in a folder
> src/main/java/org/some after the compile step we get the class file in
> target/com/mycompany/myproject/MyClass.class
> During refactoring, forgetting to manually change the package declarations
> has as result the false sense of refactoring completion (maven doesn't
> complain)
> Please find attached a sample project with one class only demonstrating the
> issue.
> Expected result:
> maven-compiler-plugin fails with a message like 'class in directory structure
> not similar to package declaration'
> Actual result:
> maven-compiler-plugin successfully completing compilation, ignoring the
> directory structure the .java files are in.
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)