Issue Details (XML | Word | Printable)

Key: MPEAR-9
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Felipe Leme
Reporter: Sean Timm
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Ear Plugin

Dependency case mismatch causes missing dependency without error

Created: 10/Nov/03 07:30 PM   Updated: 16/Jan/05 09:02 PM   Resolved: 16/Jan/05 08:51 PM
Component/s: None
Affects Version/s: 1.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File ear-caseissue-plugin.jelly.diff (1 kB)

Environment: Windows (or any other operating system setup to allow case-insensitive retrieval of dependencies from the repository)
Issue Links:
Supercedes
 
dependent
 


 Description  « Hide

I'm hosting an in-house remote repository via Apache 2 on a Windows server. I recently ran into an issue where a few projects specified the name of a dependency with the wrong case (all lowercase instead of mixed-case). The remote repository still treats it as a valid filename and returns the dependency, but it is now in the local repository with the wrong case, and this caused a bit of a problem.

At this point, I did an ear:ear, and the creation of the EAR was successful, but one of the dependencies was missing. It turns out it was due to another component having originally specified it with the wrong case, and it just maintained the wrong case from then on out.

I've modified the EAR plugin to check for this inconsistency and error out if it's detected, and I'll attach a patch shortly. Note that the WAR plugin may have this issue, too, but I haven't taken a look it it, yet.



Sean Timm added a comment - 10/Nov/03 07:31 PM

Here's the patch to fix it...


Felipe Leme added a comment - 06/Nov/04 07:48 PM

I applied the changes and am assuming it works, but I couldn't reproduce the issue (as I use Linux).


Henri Tremblay added a comment - 06/Dec/04 10:52 AM

It seems to partially work. I have the following in by build.properties:

maven.home.local=${maven.home}
maven.repo.local=${maven.home}/repository

MAVEN_HOME=c:\maven-1.0.1

The check is too powerful in this case. It compares the absolute path:

c:\maven-1.0.1\repository\mycompany\jars\myjar.jar

with the canonical:

C:\maven-1.0.1\repository\mycompany\jars\myjar.jar

Driver letter case changes between both. The workaround is to modify the MAVEN_HOME to have a capital C.

If I understood the fix correctly, I think the goal is to check only the jar name or maybe the jar and the group, not the complete path. That would solve the issue.

And I think you will hate working on the issue if you use Linux


Felipe Leme added a comment - 08/Dec/04 06:20 AM

Looks like the problem is serious, as this bug was fixed for the 1.6 release which got into maven 1.0.2


Felipe Leme added a comment - 08/Dec/04 06:23 AM

I tried to add a link to MAVEN-1526 (which was caused by the fix for this bug), but Jira failed to do so:

An error occurred: com.atlassian.core.AtlassianCoreException: Error in action: com.atlassian.jira.action.link.LinkCreate@1f795a9, result: null: [GenericEntity.set] "linktype" is not a field of IssueLink


Felipe Leme added a comment - 08/Dec/04 07:13 AM

Henri,

I changed the code to only issue a warning. Could you please install the latest maven-ear-plugin from CVS (or download it from my page at apache, running the command maven plugin:download -Dmaven.repo.remote=http://apache.org/~felipeal/maven_repo -DgroupId=maven -DartifactId=maven-ear-plugin -Dversion=1.7-SNAPSHOT) and see it works now?

Thanks again,

Felipe

PS: if it works, could you please post the warning messages here?


Felipe Leme added a comment - 09/Dec/04 07:27 AM

I'm marking as fixed, but will cut the release only this Saturday - so users will have more time testing it


Felipe Leme added a comment - 09/Dec/04 07:37 AM

I will be releasing maven-ear-plugin 1.6.1 over the weekend. Meanwhile, I provided a 'pre-release' to be tested by those having these issues.

You can install it using the following command:

maven plugin:download -Dmaven.repo.remote=http://apache.org/~felipeal/maven_repo -DgroupId=maven -DartifactId=maven-ear-plugin -Dversion=1.6.1-SNAPSHOT

So, for those having issues with the ear plugin bundled with Maven 1.0.2, please try this new version and let us know the result.

Thanks (and sorry for the hassle

– Felipe


Felipe Leme added a comment - 16/Jan/05 08:51 PM

I'm undoing the fix, as it introduced more issues than it solved.