You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org> on 2008/07/31 12:30:26 UTC

[jira] Created: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Problem, the ear can be buildt with two artifact in same version if a classifier is specified
---------------------------------------------------------------------------------------------

                 Key: MEAR-89
                 URL: http://jira.codehaus.org/browse/MEAR-89
             Project: Maven 2.x Ear Plugin
          Issue Type: Bug
            Reporter: Nicolas Mercereau


For example :
I have an ear with 2 dependencies
EAR_EXAMPLE :
-> lib1.jar:alpha
-> lib2.jar:beta
I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.

lib2 has a dependency to lib1
lib2 :beta
-> lib1:alpha

And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
EAR_EXAMPLE :
-> lib1.jar:alpha:classifier=obf
-> lib2.jar:beta

The problem is that in the EAR, i obtains :
- lib1.jar (which is in fact : lib1-aplha-obf.jar)
- lib2.jar
- and lib1-alpha.jar (which i does not want)

The file lib1-alpha.jar is get by the transitive dependencies of lib2.

I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144064#action_144064 ] 

Stephane Nicoll commented on MEAR-89:
-------------------------------------

OK, now I get it. 

You will never be able to find a solution to your problem (and I've spent enough time on this. If I remember correctly, we already discussed the obfuscation issue on the user list a while back the two of us).

And it's not perhaps, you *ARE* violating a basic principle in Maven. If it's isolated in EAR generation only, you should be fine but that's not ideal of course.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephane Nicoll closed MEAR-89.
-------------------------------

      Assignee: Stephane Nicoll
    Resolution: Won't Fix

What you're trying to do is wrong.

An artifact with a given classifier is a different artifact from a maven dependency point of view so it is perfectly normal that maven brings lib1.jar if the projects depends on it.

Handling classified deps is not an easy task but I had to do that at work and here's how I fixed the problem.

First, add a properties in your parent pom

<obfuscated>obf</obfuscated>

Now, *IN EACH DEPENDENCY* that can be obfuscated, declared it this way

<dependency>
  <groupId>foo</groupId>
  <artifactId>lib1</artifactId>
  <version>blablabal</version>
  <classifier>${obfuscated}</classifier>
</dependency>

If you want to work with the non obfuscated jar, you need to do mvn -Dobfuscated= package (empty string = no classifier, hence the main artifact)

There is no other clean way to do it. What you are doing is wrong so if you're relying on the patched version of the EAR plugin, you better have to clean your dependencies management instead.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144054#action_144054 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

Effectively you are right.
lib2 non obfuscated bring lib1 non obfuscated

But i want to assemble an EAR (version 1.2.3-protected) with a lib1 obfuscated and a lib2 non obfuscated.
And i want to assemble an EAR (version 1.2.3) with a lib1 non obfuscated and a lib2 non obfuscated.

In my company, the classifier "obfuscated" are only used in the project EAR.

I am sorry, perhaps effectively our use of plugin ear is wrong and violates a basic principle in Maven.
But we need to build differents version of EAR (with only lib1 obfuscated or not).

Tanks for the time you spend trying to help me.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144072#action_144072 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

I got probably your replies the wrong way.
Probably because i have to learn english more (i am french and try to learn more english effectively), or perhaps because your answer and your explanations weren't very good.

You speak english better than me, but you have to learn peace and tolerance.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144048#action_144048 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

As i explained, my dependencies are good.
My lib1 (non obfuscated) is coming from lib2.

One solution is in the EAR to add an exclusion of lib1 in the dependency of lib2 :
<dependency>
<groupId>foo</groupId>
<artifactId>lib2</artifactId>
<version>blablabal</version>
			<exclusions>
				<exclusion>
					<groupId>foo</groupId>
					<artifactId>lib1</artifactId>
				</exclusion>
			</exclusions>
</dependency>

But it is a simple exemple, with more libraries i can't add all exclusions for all my librairies.


I will use my plugin with my own patch.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Mercereau updated MEAR-89:
----------------------------------

    Attachment: patch_EAR_plugin_MEAR-89.txt

the patch of correction

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144069#action_144069 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

Ok, i leave this issue.

We have never discussed the two of us on the user list about obfuscation.
And i have never participated on any user list about maven.

I proposed only a patch for what was seem like a bug for me.

And YOU DON'T HAVE TO be so unpleasant like that.

I proposed a patch and i wanted to be sure you have understand my problem.

If you think it is not corresponding to the principe of maven : ok no problem.
But you could explain it with peace and tolerance.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephane Nicoll closed MEAR-89.
-------------------------------

    Resolution: Won't Fix

Don't reopen the issue, this is not a support forum.

Your dependencies management section is wrong as I told you.

Run "mvn dependency:tree" to see where lib1 (non obfuscated) is coming from. Once you have found that, fix the related pom.

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144071#action_144071 ] 

Stephane Nicoll commented on MEAR-89:
-------------------------------------

Learn English dude. If you feel that I am unpleasant, it's most probably because you get my replies the wrong way. 

(Oh and that first sentence was unpleasant, so that you know).

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144022#action_144022 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

It is already what i do.

I have these dependencies in my EAR :
<dependency>
   <groupId>foo</groupId>
   <artifactId>lib1</artifactId>
   <version>blablabal</version>
   <classifier>${obfuscated}</classifier>
</dependency>
<dependency>
   <groupId>foo</groupId>
   <artifactId>lib2</artifactId>
   <version>blablabal</version>
</dependency>

And in lib2 i have this dependencies :
<dependency>
   <groupId>foo</groupId>
   <artifactId>lib1</artifactId>
   <version>blablabal</version>
</dependency>
No raison to have a dependency to the classifier obf because the obfuscation is only needed in the EAR.

I build my EAR with a profile -Pobfuscate when i want an EAR with an obfuscated lib1, and with no profile otherwise.
But, as i have explained, in the EAR the lib2 always pull the lib1 non obfuscated even if the lib1 obfuscated is pulled directly by the ear..

Have you got another idea ?

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143771#action_143771 ] 

Nicolas Mercereau commented on MEAR-89:
---------------------------------------

I propose a patch on the EARMojo.java file : patch_EAR_plugin_MEAR-89.txt
I have tested the modifications with this patch and it works.

It would be great to integrate it in the next release 2.3.2 (we can yet improve the modification i proposed).

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Nicolas Mercereau (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Mercereau reopened MEAR-89:
-----------------------------------


> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MEAR-89) Problem, the ear can be buildt with two artifact in same version if a classifier is specified

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MEAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144051#action_144051 ] 

Stephane Nicoll commented on MEAR-89:
-------------------------------------

but it should not, that's what I am saying from day 1.

lib2 obfuscated should bring lib1 obfuscated
lib2 non obfuscated (no classifier) should bring lib1 non obfuscated

It's a simple as that. And your patched version is wrong and violates a basic principle in Maven. You'll most probably have troubles with other plugins as well as soon as you will have to use the classpath or some packaging goals.
 

> Problem, the ear can be buildt with two artifact in same version if a classifier is specified
> ---------------------------------------------------------------------------------------------
>
>                 Key: MEAR-89
>                 URL: http://jira.codehaus.org/browse/MEAR-89
>             Project: Maven 2.x Ear Plugin
>          Issue Type: Bug
>            Reporter: Nicolas Mercereau
>            Assignee: Stephane Nicoll
>         Attachments: patch_EAR_plugin_MEAR-89.txt
>
>
> For example :
> I have an ear with 2 dependencies
> EAR_EXAMPLE :
> -> lib1.jar:alpha
> -> lib2.jar:beta
> I use the bundleFinalName to rename the lib1.jar and lib2.jar in order not to have the version in the name of the jar in the ear buildt (eg : not to have lib1-alpha.jar). So i have an ear wich contains lib1.jar and lib2.jar.
> lib2 has a dependency to lib1
> lib2 :beta
> -> lib1:alpha
> And now i deploy the lib1 in version alpha with a new classifier "obf" (the repository has two jars, the one normal : lib1-alpha.jar and the one obfuscated : lib1-aplha-obf.jar).
> And i want to build an EAR with the classifier "obf" for lib1 and lib2 (without classifier for lib2).
> EAR_EXAMPLE :
> -> lib1.jar:alpha:classifier=obf
> -> lib2.jar:beta
> The problem is that in the EAR, i obtains :
> - lib1.jar (which is in fact : lib1-aplha-obf.jar)
> - lib2.jar
> - and lib1-alpha.jar (which i does not want)
> The file lib1-alpha.jar is get by the transitive dependencies of lib2.
> I think it is a bug because the EAR should not take the lib1-alpha.jar, because it has already include the lib1-aplha-obf.jar which corresponds to the same artifact in the same version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira