Why can't you just use the exclusions tag under the child dependency tag(s)
in question?

This should exclude the child's excluded dependencies from being added to
the classpath.  Isn't that what you are trying to do?

John


On 8/20/07, Wayne Fay <[EMAIL PROTECTED]> wrote:
>
> Ultimately, you're still using this property substitution thing, which
> I think is screwing things up.
>
> Please try it with "properly declared" versions in the depMgmt
> section. If that works, then you know you're simply having troubles
> with the property substitution. If it doesn't work, then you've got
> other problems. Or if you're into TDD: make it green, then make it
> red, then play until its green again, etc.
>
> Also, as others have mentioned, you might want to look at
> pluginManagement as well.
>
> Wayne
>
> On 8/20/07, Farrukh Najmi <[EMAIL PROTECTED]> wrote:
> > Farrukh Najmi wrote:
> > > Thank you Wayne! I had completely missed this subtle but important
> > > distinction between <dependencies> and <dependencyManagement>..
> > >
> > > So I tried this out. It seems to work but not for dependencies that
> > > are plugin dependencies in child poms.
> > >
> > > In my parent pom I specified....
> > >
> > >    <dependencyManagement>
> > >        <dependencies>
> > >
> > > ....                     <dependency>
> > >                <groupId>com.sun.xml.ws</groupId>
> > >                <artifactId>jaxws-rt</artifactId>
> > >                <version>${jaxws.version}</version>
> > >            </dependency>
> > >            <dependency>
> > >                <groupId>com.sun.xml.ws</groupId>
> > >                <artifactId>jaxws-tools</artifactId>
> > >                <version>${jaxws.version}</version>
> > >            </dependency>                        </dependencies>
> > >    </dependencyManagement>
> > >
> > >    <properties>
> > >        <jaxws.version>2.1.3-SNAPSHOT</jaxws.version>
> > >    </properties>
> > >
> > > Then in my child pom I specified:
> > >
> > >    <build>
> > >        <plugins>
> > >            <plugin>
> > >                <groupId>org.codehaus.mojo</groupId>
> > >                <artifactId>jaxws-maven-plugin</artifactId>
> > >                <executions>
> > >                    <execution>
> > >                        <goals>
> > >                            <goal>wsimport</goal>
> > >                        </goals>
> > >                    </execution>
> > >                </executions>
> > >                <configuration>
> > >                       ....
> > >                </configuration>
> > >                <dependencies>
> > >                    <dependency>
> > >                        <groupId>com.sun.xml.ws</groupId>
> > >                        <artifactId>jaxws-tools</artifactId>
> > >                    </dependency>
> > >                    <dependency>
> > >                        <groupId>com.sun.xml.ws</groupId>
> > >                        <artifactId>jaxws-rt</artifactId>
> > >                    </dependency>
> > >
> > >                     ....
> </dependencies>
> > >            </plugin>
> > >                           </plugins>                  </build>
> > >
> > > With this I got the following error:
> > >
> > > [ERROR]FATAL ERROR
> > >
> >
> [INFO]------------------------------------------------------------------------
> > >
> > > [INFO]An invalid artifact was detected.
> > > [INFO]
> > > [INFO]This artifact might be in your project's POM, or it might have
> > > been included transitively during the resolution process. Here is the
> > > information we do have for this artifact:
> > > [INFO]
> > > [INFO]    o GroupID:     com.sun.xml.ws
> > > [INFO]    o ArtifactID:  jaxws-tools
> > > [INFO]    o Version:     <<< MISSING >>>
> > > [INFO]    o Type:        jar
> > >
> >
> [INFO]------------------------------------------------------------------------
> > >
> > > [DEBUG]Trace
> > > org.apache.maven.artifact.InvalidArtifactRTException: For artifact
> > > {com.sun.xml.ws:jaxws-tools:null:jar}: The version cannot be empty.
> > >        at
> > >
> > org.apache.maven.artifact.DefaultArtifact.validateIdentity(
> DefaultArtifact.java:144)
> > >
> > >        at
> > > org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java
> :119)
> > >
> > >        at
> > >
> > org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(
> DefaultArtifactFactory.java:155)
> > >
> > >        at
> > >
> >
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact
> (DefaultArtifactFactory.java:67)
> > >
> > >        at
> > >
> > org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(
> MavenMetadataSource.java:330)
> > >
> > >        at
> > >
> > org.apache.maven.plugin.DefaultPluginManager.addPlugin(
> DefaultPluginManager.java:316)
> > >
> > >        at
> > >
> > org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(
> DefaultPluginManager.java:198)
> > >
> > >        at
> > >
> > org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(
> DefaultPluginManager.java:163)
> > >
> > >        at
> > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(
> DefaultLifecycleExecutor.java:1328)
> > >
> > >        at
> > >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindPluginToLifecycle(
> DefaultLifecycleExecutor.java:1292)
> > >
> > >        at
> > >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings
> (DefaultLifecycleExecutor.java:1058)
> > >
> > >        at
> > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:529)
> > >
> > >        at
> > >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:309)
> > >
> > >        at
> > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:276)
> > >
> > >        at
> > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:143)
> > >
> > >        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
> :393)
> > >        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182)
> > >        at
> > > org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java
> :760)
> > >        at
> > >
> > org.codehaus.mevenide.netbeans.execute.MavenJavaExecutor.run(
> MavenJavaExecutor.java:257)
> > >
> > >        at
> > > org.netbeans.core.execution.RunClassThread.run(RunClassThread.java
> :131)
> > >
> > > It seems the problem is only for plugin dependencies and not project
> > > dependencies.
> > > What am I doing wrong now? Thanks very much for your help.
> > >
> >
> > It getting even worse as I get to building projects that depend upon my
> > child pom.
> >
> > It seems that because I am missing version tag on dependencies in my
> > child pom,
> > if another project depends upon the child pom's project then I get
> > errors like:
> >
> >
> > [WARN]POM for 'my.child.project:pom:4.0-SNAPSHOT:compile' is invalid. It
> > will be ignored for artifact resolution. Reason: Failed to validate POM
> > [DEBUG]Reason: Failed to validate POM
> > [DEBUG]
> > [DEBUG]Validation Errors:
> > [DEBUG]'dependencies.dependency.version' is missing for junit:junit
> > [DEBUG]'dependencies.dependency.version' is missing for
> javax.xml:jaxr-api
> > [DEBUG]'dependencies.dependency.version' is missing for
> > com.sun.xml.ws:jaxws-rt
> > [DEBUG]'dependencies.dependency.version' is missing for
> > com.sun.xml.ws:jaxws-tools
> >
> > Indeed the versions are missing in that pom because they are specified
> > in the parent pom's dependencyManagent section.
> >
> > Above problem results in losing transitive dependencies from the pom
> > that was ignored due to above error.
> > The result is a compilation error :-(
> >
> > I must say that I am not a maven newbie, I am an experienced developer,
> > I have RTFM by now several times and I am still finding this maven
> > dependency stuff quite difficult to grok as to what is the expected
> > behavior and how to make things work for what seems to be a common use
> case.
> >
> > Thanks for any help on my latest problem above.
> >
> > --
> > Regards,
> > Farrukh
> >
> > Web: http://www.wellfleetsoftware.com
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to