ran mvn package against pom.xml from supplied project.zip with no missing
dependencies:
[DEBUG] Goal:
org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appendAssemblyId default-value="true">${appendAssemblyId}</appendAssemblyId>
<attach default-value="true">${attach}</attach>
<basedir default-value="${basedir}"/>
<classifier>${classifier}</classifier>
<descriptor>${descriptor}</descriptor>
<descriptorId>${descriptorId}</descriptorId>
<descriptors>
<descriptor>src/main/assembly/assembly-descriptor.xml</descriptor>
</descriptors>
<dryRun default-value="false">${assembly.dryRun}</dryRun>
<finalName default-value="${project.build.finalName}"/>
<ignoreDirFormatExtensions default-value="true"/>
<ignoreMissingDescriptor
default-value="false">${ignoreMissingDescriptor}</ignoreMissingDescriptor>
<includeSite default-value="false">${includeSite}</includeSite>
<localRepository default-value="${localRepository}"/>
<mavenSession>${session}</mavenSession>
<outputDirectory default-value="${project.build.directory}"/>
<project default-value="${project}"/>
<reactorProjects default-value="${reactorProjects}"/>
<remoteRepositories default-value="${project.remoteArtifactRepositories}"/>
<runOnlyAtExecutionRoot
default-value="false">${runOnlyAtExecutionRoot}</runOnlyAtExecutionRoot>
<siteDirectory default-value="${project.reporting.outputDirectory}"/>
<skipAssembly default-value="false">${skipAssembly}</skipAssembly>
<tarLongFileMode default-value="warn">${tarLongFileMode}</tarLongFileMode>
<tempRoot default-value="${project.build.directory}/archive-tmp"/>
<workDirectory default-value="${project.build.directory}/assembly/work"/>
</configuration>
[DEBUG] =======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1972051,
ConflictMarker.markTime=738132, ConflictMarker.nodeCount=84,
ConflictIdSorter.graphTime=1371731, ConflictIdSorter.topsortTime=935252,
ConflictIdSorter.conflictIdCount=24, ConflictIdSorter.conflictIdCycleCount=3,
ConflictResolver.totalTime=8674975, ConflictResolver.conflictItemCount=82,
DefaultDependencyCollector.collectTime=137005478,
DefaultDependencyCollector.transformTime=16792725}
[DEBUG] ru.spi2.test:sbercap-dependencies:jar:1.0-SNAPSHOT
[DEBUG] org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:fop:jar:0.94:compile
[DEBUG] org.apache.xmlgraphics:xmlgraphics-commons:jar:1.2:compile
[DEBUG] commons-logging:commons-logging:jar:1.0.4:compile
[DEBUG] commons-io:commons-io:jar:1.1:compile
[DEBUG]
org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[DEBUG]
org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[DEBUG] org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-anim:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-css:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-parser:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-script:jar:1.7:compile
[DEBUG] org.apache.xmlgraphics:batik-js:jar:1.7:compile
I am baffled why your dependency manager is skipping batik-js:1.7?
with same pom.xml can you
mvn dependency:tree >output
and send us output
?
Martin
______________________________________________
________________________________
From: Сергей Вайсман <[email protected]>
Sent: Monday, April 2, 2018 10:24 AM
To: [email protected]
Subject: Dependency is missed while using maven-assembly-plugin
Hello.
I have a problem using maven-assembly-plugin.
I want to get during package phase a directory with all project dependencies.
But I have a transitive dependency with compile scope which is missed from
assembly output directory.
The missed jar is batik-js-1.7.jar. Here is a dependency tree for this jar
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @
sbercap-dependencies ---
[INFO] ru.spi2.test:sbercap-dependencies:jar:1.0-SNAPSHOT
[INFO] \- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile
...
[INFO] +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-script:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-js:jar:1.7:compile
...
When assembly plugin is finished, others dependencies (batik-anim-1.7.jar,
batik-css-1.7.jar) are added to output directory successfully. The
batik-js-1.7.jar
is missed (screenshot no-batik-js-in-assembly-output.png attached).
On the other side, if I try to copy all dependencies using
maven-dependency-plugin,
the batik-js-1.7.jar is successfully added to the folder (screenshot
batik-js-in-dependencies attached).
Here is my dependencies and build blocks from pom.xml
<dependencies>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/dependency-libs
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly-descriptor.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
The assembly descriptor is
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>assembly</id>
<formats>
<format>dir</format>
</formats>
<dependencySets>
<dependencySet>
</dependencySet>
</dependencySets>
</assembly>
Could you explain me, am I doing something wrong? Why this library is missed
from assembly output?
I attached a simple maven project with one dependency to reproduce the problem.\
See project.zip in attach.
I tried to find any similar problem in google but there were another problems -
found cases when dependency from test scope or missed dependency in pom.xml.
In my situation dependency is in compile scope and declared in pom.xml right.
Dependency set useTransitiveDependencies property is true by default, so I don't
really know why I get this result of assembly plugin.
My maven version:
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1;
2014-12-14T20:29:23+03:00)
Maven home: C:\soft\apache-maven-3.2.5
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_131\jre
Default locale: ru_RU, platform encoding: Cp1251
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
maven-assembly-plugin version is 2.5
Could you help me, please?
Thanks.
--
Regards,
Sergey Vaysman.