jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Ear Plugin
  • MEAR-73

Property to disable transitive dependencies resolving

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Labels:
    None

Description

We have ears with a lot of modules. So the transitive dependencies are very huge and to exclude all these with <excluded>true</excluded> is no option. Also to mark these dependencies with optional is no way. It is possible to create a new property for that?

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    patch.txt
    26/Jul/07 9:03 AM
    3 kB
    Thomas Hart
  2. Text File
    patch2.txt
    27/Jul/07 3:33 AM
    1 kB
    Thomas Hart
  1. ear.jpg
    12 kB
    26/Jul/07 12:31 PM

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Stéphane Nicoll added a comment - 25/Jul/07 7:39 AM

Not sure it's EAR-plugin related. This sounds more like a maven-core functionnality to me.

Show
Stéphane Nicoll added a comment - 25/Jul/07 7:39 AM Not sure it's EAR-plugin related. This sounds more like a maven-core functionnality to me.
Hide
Permalink
Thomas Hart added a comment - 25/Jul/07 8:19 AM

Sorry i'm a maven newbie, i don't know where the right position is. But I think the following code block include the unwanted dependencies.

org.apache.maven.plugin.ear.AbstractEarMojo
ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() &&
  filter.include( artifact ) )
{
    EarModule module = EarModuleFactory.newEarModule( artifact, defaultLibBundleDir );
    allModules.add( module );
}

I try to use the excludeTransitive parameter for the dependency:resolve-plugins mojo. Maybe that works for me.

Show
Thomas Hart added a comment - 25/Jul/07 8:19 AM Sorry i'm a maven newbie, i don't know where the right position is. But I think the following code block include the unwanted dependencies.
org.apache.maven.plugin.ear.AbstractEarMojo
ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() &&
  filter.include( artifact ) )
{
    EarModule module = EarModuleFactory.newEarModule( artifact, defaultLibBundleDir );
    allModules.add( module );
}
I try to use the excludeTransitive parameter for the dependency:resolve-plugins mojo. Maybe that works for me.
Hide
Permalink
Stéphane Nicoll added a comment - 25/Jul/07 8:22 AM

Mmmm, true.

What you're asking is disabling transitive deps altogether or you want to disable them for a particular dependency?

Show
Stéphane Nicoll added a comment - 25/Jul/07 8:22 AM Mmmm, true. What you're asking is disabling transitive deps altogether or you want to disable them for a particular dependency?
Hide
Permalink
Thomas Hart added a comment - 25/Jul/07 8:29 AM

In my case altogether.

Show
Thomas Hart added a comment - 25/Jul/07 8:29 AM In my case altogether.
Hide
Permalink
Thomas Hart added a comment - 26/Jul/07 2:49 AM

I check the dependency plugin, it doesn't work. Can i submit a patch, that excludes the code block above?

Show
Thomas Hart added a comment - 26/Jul/07 2:49 AM I check the dependency plugin, it doesn't work. Can i submit a patch, that excludes the code block above?
Hide
Permalink
Stéphane Nicoll added a comment - 26/Jul/07 11:43 AM

no It won't do what you expect.

Show
Stéphane Nicoll added a comment - 26/Jul/07 11:43 AM no It won't do what you expect.
Hide
Permalink
Stéphane Nicoll added a comment - 26/Jul/07 11:43 AM

WDYM when you say "it doen't work"?

Show
Stéphane Nicoll added a comment - 26/Jul/07 11:43 AM WDYM when you say "it doen't work"?
Hide
Permalink
Thomas Hart added a comment - 26/Jul/07 12:29 PM

I mean that the dependency:resolve with the property excludeTransitive don't have any effects to the ear plugin.

The patch works for me. The following pom.xml produces the right ear (see image). Only the dependencies are included not the transitive dependencies.

...
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.3.1-SNAPSHOT</version>
        <configuration>
          <excludeTransitive>true</excludeTransitive>
          <version>5</version>
          <defaultLibBundleDir>lib</defaultLibBundleDir>
          <modules>
            <ejbModule>
              <groupId>suite4p.enabler.jb402</groupId>
              <artifactId>suite4p.enabler.jb402.server</artifactId>
            </ejbModule>
          </modules>
          <jboss>
            <version>4</version>
          </jboss>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <dependencies>
    <dependency>
      <groupId>suite4p.enabler.jb402</groupId>
      <artifactId>suite4p.enabler.jb402.server</artifactId>
      <type>ejb</type>
    </dependency>
  </dependencies>
Show
Thomas Hart added a comment - 26/Jul/07 12:29 PM I mean that the dependency:resolve with the property excludeTransitive don't have any effects to the ear plugin. The patch works for me. The following pom.xml produces the right ear (see image). Only the dependencies are included not the transitive dependencies.
...
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.3.1-SNAPSHOT</version>
        <configuration>
          <excludeTransitive>true</excludeTransitive>
          <version>5</version>
          <defaultLibBundleDir>lib</defaultLibBundleDir>
          <modules>
            <ejbModule>
              <groupId>suite4p.enabler.jb402</groupId>
              <artifactId>suite4p.enabler.jb402.server</artifactId>
            </ejbModule>
          </modules>
          <jboss>
            <version>4</version>
          </jboss>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <dependencies>
    <dependency>
      <groupId>suite4p.enabler.jb402</groupId>
      <artifactId>suite4p.enabler.jb402.server</artifactId>
      <type>ejb</type>
    </dependency>
  </dependencies>
Hide
Permalink
Stéphane Nicoll added a comment - 26/Jul/07 3:01 PM

> I mean that the dependency:resolve with the property excludeTransitive don't have any effects to the ear plugin.

Well I wonder how it could have any effect.

And your patch is plain wrong anyway: it works as a side effect. since you have a single dependency and non scope dependencies. Trust me, your simple project does not reflect how this plugin is used at all.

Show
Stéphane Nicoll added a comment - 26/Jul/07 3:01 PM > I mean that the dependency:resolve with the property excludeTransitive don't have any effects to the ear plugin. Well I wonder how it could have any effect. And your patch is plain wrong anyway: it works as a side effect. since you have a single dependency and non scope dependencies. Trust me, your simple project does not reflect how this plugin is used at all.
Hide
Permalink
Stéphane Nicoll added a comment - 26/Jul/07 3:02 PM

also note that you don't need the ejbModule entry at all. It's only used if you want to customize module's parameters (bundle file name, uri, etc)

Show
Stéphane Nicoll added a comment - 26/Jul/07 3:02 PM also note that you don't need the ejbModule entry at all. It's only used if you want to customize module's parameters (bundle file name, uri, etc)
Hide
Permalink
Thomas Hart added a comment - 27/Jul/07 3:32 AM

Ok i see it. Your are right, the patch is wrong.

Please give me a second try, i think project.getArtifacts() is the right place. To get the list with no transitive dependencies simply use project.getDependencyArtifacts().

Show
Thomas Hart added a comment - 27/Jul/07 3:32 AM Ok i see it. Your are right, the patch is wrong. Please give me a second try, i think project.getArtifacts() is the right place. To get the list with no transitive dependencies simply use project.getDependencyArtifacts().
Hide
Permalink
Kaizer Sogiawala added a comment - 13/May/08 9:10 AM

Hi Stephane,

Any chance of getting this in? Looks like the above change will not affect the normal flow. This allows folks to explicitly choose what gets EARed up and not worry about transitive dependencies.

Show
Kaizer Sogiawala added a comment - 13/May/08 9:10 AM Hi Stephane, Any chance of getting this in? Looks like the above change will not affect the normal flow. This allows folks to explicitly choose what gets EARed up and not worry about transitive dependencies.
Hide
Permalink
Stéphane Nicoll added a comment - 20/May/08 11:25 AM

It's missing test cases so I need to write them first. But that sounds reasonable indeed. It's just not complete as a patch for now.

Show
Stéphane Nicoll added a comment - 20/May/08 11:25 AM It's missing test cases so I need to write them first. But that sounds reasonable indeed. It's just not complete as a patch for now.
Hide
Permalink
Kannan Kesavan added a comment - 10/Jun/09 12:18 AM

Hi,

We are also facing same issue in maven-ear-plugin. In our project, one of our transitive dependency using ".so" files. In that project, they didn't specify any scope for ".so" files. Also it is not possible for us to give scope (entirely different project, and it is not in our hands to change/give scope). Finally when we build our ear module, it is throwing unknown artifact types[so].

Could you please let me know when it will be fixed?

Thanks,
Kannan

Show
Kannan Kesavan added a comment - 10/Jun/09 12:18 AM Hi, We are also facing same issue in maven-ear-plugin. In our project, one of our transitive dependency using ".so" files. In that project, they didn't specify any scope for ".so" files. Also it is not possible for us to give scope (entirely different project, and it is not in our hands to change/give scope). Finally when we build our ear module, it is throwing unknown artifact types[so]. Could you please let me know when it will be fixed? Thanks, Kannan
Hide
Permalink
Stéphane Nicoll added a comment - 10/Jun/09 1:15 AM

you can exclude the dependency. Defining the so dependency again with scope provided will most probably fix the issue

Show
Stéphane Nicoll added a comment - 10/Jun/09 1:15 AM you can exclude the dependency. Defining the so dependency again with scope provided will most probably fix the issue

People

  • Assignee:
    Stéphane Nicoll
    Reporter:
    Thomas Hart
Vote (5)
Watch (6)

Dates

  • Created:
    25/Jul/07 6:58 AM
    Updated:
    10/Jun/09 1:15 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.