4

I have the following maven parent project with several modules

<parent>
        <artifactId>ppdf-3party-demo</artifactId>
        <groupId>edu.i2r</groupId>
        <version>1.0</version>
    </parent>

    <groupId>edu.i2r</groupId>
    <artifactId>ppdf-3party-demo-client</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>

    <name>ppdf-3party-demo-client</name>

    <modules>
        <module>demo-client-app</module>
        <module>demo-client-model</module>
        <module>demo-client-persist</module>
        <module>demo-client-swing</module>
        <module>demo-client-encryptservice</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat</artifactId>
            <version>7.0.35</version>
            <type>zip</type>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/bin-package.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>distro-assembly</id>
                        <!-- <phase>package</phase> -->
                        <!-- <goals> -->
                        <!-- <goal>single</goal> -->
                        <!-- </goals> -->
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>unpack-tomcat</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.tomcat</groupId>
                                    <artifactId>tomcat</artifactId>
                                    <version>7.0.35</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.4,)
                                        </versionRange>
                                        <goals>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

Inside demo-client-persist I have a dependency on spring-jdbc

    <parent>
    <groupId>edu.i2r</groupId>
    <artifactId>ppdf-3party-demo-client</artifactId>
    <version>1.0</version>
  </parent>

  <artifactId>demo-client-persist</artifactId>
  <name>demo-client-persist</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>edu.i2r</groupId>
      <artifactId>demo-client-model</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>edu.i2r</groupId>
      <artifactId>ppdf-demo-common</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>
</project>

Finally, I have the following assembly descriptor

  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
        <outputDirectory>lib</outputDirectory>
        <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
  <fileSets>

Running mvn assembly:assembly, the output directory seemed to work, as dependencies are copied to the lib directory. However, just the spring-jdbc jar wasn't there.

Did i miss out anything?

goh
  • 27,631
  • 28
  • 89
  • 151

2 Answers2

0

There might be an error during the build at the very beginning saying that as a result of this error transitive dependencies have been disabled.

Andrey Chaschev
  • 16,160
  • 5
  • 51
  • 68
0

Some warnings may be ignored when you run mvn assembly:assembly.

## [WARNING] Invalid POM for ${group}:${artifact}:${type}:${version}, transitive dependencies (if any) will not be available, enable debug logging for more details
 ##

You can run maven with option '-X' to see the details. And in my case, the problem is solved by removing the _remote.repositories file in the local maven cache (~/.m2)

You may want to have a look at this post: "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository

Wang Zhong
  • 125
  • 2
  • 9