Dependency is missed while using maven-assembly-plugin

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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.





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

project.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dependency is missed while using maven-assembly-plugin

mgainty
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: Сергей Вайсман <[hidden email]>
Sent: Monday, April 2, 2018 10:24 AM
To: [hidden email]
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.



Reply | Threaded
Open this post in threaded view
|

Re: Dependency is missed while using maven-assembly-plugin

Сергей Вайсман
Hello, Martin

Thank you for the response.

The first thing I need to mention that I gave you a wrong version of
maven-assembly-plugin.
Maven-assembly-plugin version: 2.2-beta-5
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"

This is output of dependency:tree for the project.zip. As you can see
there is a batik-js in the tree. Also, the maven-dependency-plugin
finds this dependency.

$ mvn dependency:tree

[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building sbercap-dependencies 1.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[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:fop:jar:0.94:compile
[INFO]    |  +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.2:compile
[INFO]    |  +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO]    |  +- commons-io:commons-io:jar:1.1:compile
[INFO]    |  +-
org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO]    |  \-
org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO]    +- org.apache.xmlgraphics:batik-awt-util: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
[INFO]    |  \- xalan:xalan:jar:2.6.0:compile
[INFO]    +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
[INFO]    +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
[INFO]    +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
[INFO]    +- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile
[INFO]    +- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO]    +- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
[INFO]    +- xml-apis:xml-apis:jar:1.3.04:compile
[INFO]    \- xml-apis:xml-apis-ext:jar:1.3.04:compile
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.156 s
[INFO] Finished at: 2018-04-03T09:55:49+03:00
[INFO] Final Memory: 12M/491M
[INFO]
------------------------------------------------------------------------

I attached dependency-tree.log

Also I ran mvn package -X and and tried to analyze it. I attached this
information
to build.log file.
As you can see the batik-js dependency is appear during the whole
package process
until maven-assembly-plugin:single happened.

[DEBUG]
-----------------------------------------------------------------------
[DEBUG] Goal:
org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default)
...
[DEBUG]             org.apache.xmlgraphics:batik-js:jar:1.7:compile
...
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @
sbercap-dependencies ---
...
[DEBUG]   (f) classpathElements =
[C:\Users\sergey.vaysman\Documents\irule\t53-sbercap-install\letter2-analyze\sbercap-dependencies\target\classes,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.7\batik-transcoder-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\fop\0.94\fop-0.94.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\1.2\xmlgraphics-commons-1.2.jar,
C:\Users\sergey.vaysman\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar,
C:\Users\sergey.vaysman\.m2\repository\commons-io\commons-io\1.1\commons-io-1.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\avalon\framework\avalon-framework-api\4.3.1\avalon-framework-api-4.3.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\avalon\framework\avalon-framework-impl\4.3.1\avalon-framework-impl-4.3.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.7\batik-awt-util-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.7\batik-bridge-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-anim\1.7\batik-anim-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-css\1.7\batik-css-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-ext\1.7\batik-ext-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-parser\1.7\batik-parser-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-script\1.7\batik-script-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\xalan\xalan\2.6.0\xalan-2.6.0.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-dom\1.7\batik-dom-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.7\batik-gvt-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.7\batik-svg-dom-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.7\batik-svggen-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-util\1.7\batik-util-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-xml\1.7\batik-xml-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar,
C:\Users\sergey.vaysman\.m2\repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar]
...
[DEBUG] Classpath:
[C:\Users\sergey.vaysman\Documents\irule\t53-sbercap-install\letter2-analyze\sbercap-dependencies\target\classes
...
  C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar
...
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @
sbercap-dependencies ---
...
[DEBUG]   (f) classpathElements =
[C:\Users\sergey.vaysman\Documents\irule\t53-sbercap-install\letter2-analyze\sbercap-dependencies\target\test-classes,
C:\Users\sergey.vaysman\Documents\irule\t53-sbercap-install\letter2-analyze\sbercap-dependencies\target\classes,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.7\batik-transcoder-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\fop\0.94\fop-0.94.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\1.2\xmlgraphics-commons-1.2.jar,
C:\Users\sergey.vaysman\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar,
C:\Users\sergey.vaysman\.m2\repository\commons-io\commons-io\1.1\commons-io-1.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\avalon\framework\avalon-framework-api\4.3.1\avalon-framework-api-4.3.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\avalon\framework\avalon-framework-impl\4.3.1\avalon-framework-impl-4.3.1.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.7\batik-awt-util-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.7\batik-bridge-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-anim\1.7\batik-anim-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-css\1.7\batik-css-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-ext\1.7\batik-ext-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-parser\1.7\batik-parser-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-script\1.7\batik-script-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\xalan\xalan\2.6.0\xalan-2.6.0.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-dom\1.7\batik-dom-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.7\batik-gvt-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.7\batik-svg-dom-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.7\batik-svggen-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-util\1.7\batik-util-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-xml\1.7\batik-xml-1.7.jar,
C:\Users\sergey.vaysman\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar,
C:\Users\sergey.vaysman\.m2\repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar]
...
  C:\Users\sergey.vaysman\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar
...
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @
sbercap-dependencies ---
...
[DEBUG]   (s) projectArtifactMap =
{org.apache.xmlgraphics:batik-transcoder=org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile,
org.apache.xmlgraphics:fop=org.apache.xmlgraphics:fop:jar:0.94:compile,
org.apache.xmlgraphics:xmlgraphics-commons=org.apache.xmlgraphics:xmlgraphics-commons:jar:1.2:compile,
commons-logging:commons-logging=commons-logging:commons-logging:jar:1.0.4:compile,
commons-io:commons-io=commons-io:commons-io:jar:1.1:compile,
org.apache.avalon.framework:avalon-framework-api=org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile,
org.apache.avalon.framework:avalon-framework-impl=org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile,
org.apache.xmlgraphics:batik-awt-util=org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile,
org.apache.xmlgraphics:batik-bridge=org.apache.xmlgraphics:batik-bridge:jar:1.7:compile,
org.apache.xmlgraphics:batik-anim=org.apache.xmlgraphics:batik-anim:jar:1.7:compile,
org.apache.xmlgraphics:batik-css=org.apache.xmlgraphics:batik-css:jar:1.7:compile,
org.apache.xmlgraphics:batik-ext=org.apache.xmlgraphics:batik-ext:jar:1.7:compile,
org.apache.xmlgraphics:batik-parser=org.apache.xmlgraphics:batik-parser:jar:1.7:compile,
org.apache.xmlgraphics:batik-script=org.apache.xmlgraphics:batik-script:jar:1.7:compile,
org.apache.xmlgraphics:batik-js=org.apache.xmlgraphics:batik-js:jar:1.7:compile,
xalan:xalan=xalan:xalan:jar:2.6.0:compile,
org.apache.xmlgraphics:batik-dom=org.apache.xmlgraphics:batik-dom:jar:1.7:compile,
org.apache.xmlgraphics:batik-gvt=org.apache.xmlgraphics:batik-gvt:jar:1.7:compile,
org.apache.xmlgraphics:batik-svg-dom=org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile,
org.apache.xmlgraphics:batik-svggen=org.apache.xmlgraphics:batik-svggen:jar:1.7:compile,
org.apache.xmlgraphics:batik-util=org.apache.xmlgraphics:batik-util:jar:1.7:compile,
org.apache.xmlgraphics:batik-xml=org.apache.xmlgraphics:batik-xml:jar:1.7:compile,
xml-apis:xml-apis=xml-apis:xml-apis:jar:1.3.04:compile,
xml-apis:xml-apis-ext=xml-apis:xml-apis-ext:jar:1.3.04:compile}
...
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (copy) @
sbercap-dependencies ---
...
[INFO] Copying batik-js-1.7.jar to
C:\Users\sergey.vaysman\Documents\irule\t53-sbercap-install\letter2-analyze\sbercap-dependencies\target\dependency-libs\batik-js-1.7.jar
...
[INFO] --- maven-assembly-plugin:2.2-beta-5:single (default) @
sbercap-dependencies ---
 >>> There is no batik-js dependency anymore



--
Regards,
Sergey Vaysman.





On 03.04.2018 1:31, Martin Gainty wrote:

> 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: Сергей Вайсман <[hidden email]>
> Sent: Monday, April 2, 2018 10:24 AM
> To: [hidden email]
> 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.
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

dependency-tree.log (2K) Download Attachment
build.log (189K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Dependency is missed while using maven-assembly-plugin

Thorsten Heit-3
Hi,

> The first thing I need to mention that I gave you a wrong version of
> maven-assembly-plugin.
> Maven-assembly-plugin version: 2.2-beta-5
> 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"

Can you try with with m-assembly-p 3.1.0 and see whether this behaves
different?
Could you switch to a newer version of Maven, i.e. 3.5.3 (the newest?


Regards

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: Dependency is missed while using maven-assembly-plugin

Сергей Вайсман
Hello, Thorsten

I updated to the latest maven version 3.5.3 and configured the project
to use
the latest maven-assembly-plugin version 3.1.0.

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297;
2018-02-24T22:49:05+03:00)
Maven home: C:\soft\apache-maven-3.5.3\bin\..
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: "windows"

The problem is reproduced.
I attached the project as project.zip, mvn dependency:tree -X
(dependency-tree.log)
and mvn package -X (build.log).

The problem is the same - batik.js appears during package phase until
the maven-assembly-plugin:single step.

--
Regards,
Sergey Vaysman


On 03.04.2018 11:55, Thorsten Heit wrote:

> Hi,
>
>> The first thing I need to mention that I gave you a wrong version of
>> maven-assembly-plugin.
>> Maven-assembly-plugin version: 2.2-beta-5
>> 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"
> Can you try with with m-assembly-p 3.1.0 and see whether this behaves
> different?
> Could you switch to a newer version of Maven, i.e. 3.5.3 (the newest?
>
>
> Regards
>
> Thorsten


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

project.zip (4K) Download Attachment
dependency-tree.log (2K) Download Attachment
build.log (175K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Dependency is missed while using maven-assembly-plugin

Thorsten Heit-3
Hi Sergey,

> I updated to the latest maven version 3.5.3 and configured the project
> to use
> the latest maven-assembly-plugin version 3.1.0.

You seem to be hit by
https://issues.apache.org/jira/projects/MASSEMBLY/issues/MASSEMBLY-782.

In short: You have circular dependencies in Batik 1.7:
batik-bridge -> batik-script -> batik-bridge...

Can you use a newer version of batik-transcoder such as 1.8, 1.9 or 1.9.1
(all available on Maven Central)?


Regards

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: Dependency is missed while using maven-assembly-plugin

Сергей Вайсман
Hello, Thorsten

Thank you very much for the help! Yes, this is the reason of my problem.

I tested it on next releases of batik and found that the dependency
structure
changed in next versions and there's no batik-js in dependency tree.
Unfortunately, I couldn't upgrade version because in real project these
batik 1.7 libraries are used in some third-party plugin used by our
GUI developers.

For my case it was convenient to use exclusions for batik-script and
batik-bridge. And use these excluded dependencies external.
Like this.

     <dependencies>
         <dependency>
             <groupId>internal-module-groupId</groupId>
<artifactId>internal-module-artifactId</artifactId>
             <exclusions>
                 <exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-bridge</artifactId>
                 </exclusion>
                 <exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-script</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.xmlgraphics</groupId>
             <artifactId>batik-script</artifactId>
             <version>1.7</version>
         </dependency>
         <dependency>
             <groupId>org.apache.xmlgraphics</groupId>
             <artifactId>batik-bridge</artifactId>
             <version>1.7</version>
         </dependency>
     </dependencies>


Anyway, thank you for your responses!
Have a nice day!


--
Regards,
Sergey Vaysman


On 03.04.2018 14:05, Thorsten Heit wrote:

> Hi Sergey,
>
>> I updated to the latest maven version 3.5.3 and configured the project
>> to use
>> the latest maven-assembly-plugin version 3.1.0.
> You seem to be hit by
> https://issues.apache.org/jira/projects/MASSEMBLY/issues/MASSEMBLY-782.
>
> In short: You have circular dependencies in Batik 1.7:
> batik-bridge -> batik-script -> batik-bridge...
>
> Can you use a newer version of batik-transcoder such as 1.8, 1.9 or 1.9.1
> (all available on Maven Central)?
>
>
> Regards
>
> Thorsten


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]