Dependency is missed in output after maven-assembly-plugin executed - maven

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 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
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>
<version>3.1.0</version>
<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 tried to find any similar problem in google but there were another problems -
dependency from test scope or missed dependency in pom.xml. 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.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"
maven-assembly-plugin version is 3.1.0
Could you help me, please?
Thanks.

There is a problem with adding transitive dependency using maven-assembly-plugin if this dependency was declared in circular dependency.
https://issues.apache.org/jira/projects/MASSEMBLY/issues/MASSEMBLY-782
org.apache.xmlgraphics:batik-...:1.7 has circular dependency between batik-bridge and batik-script.
You can choose several options to solve this problem.
Update to newer version of batik-... library which doesn't have any circular dependencies.
If you can't use previous option, you can configure pom.xml - exclude circular dependencies and extract them to have this dependencies as non-transitive.
<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>
Thanks to Thorsten Heit from maven users mailing list for the help.

Related

Liquibase 3.3.3 refusing to run "due to maven configuration"

Did something change in liquibase between version 2 and version 3?
I have the following in my pom file...
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.3.3</version>
<configuration>
<changeLogFile>src/main/resources/liquibase/liquibase-changesets.xml</changeLogFile>
<driver>${db.liquibase.driver}</driver>
<username>${db.liquibase.username}</username>
<password>${db.liquibase.password}</password>
<url>${db.liquibase.url}</url>
<promptOnNonLocalDatabase>${db.liquibase.promptOnNonLocal}</promptOnNonLocalDatabase>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
</dependencies>
</plugin>
And I get the following when I run liquibase:update...
------------------------------------------------------------------------
Building ********** 1.0-SNAPSHOT
------------------------------------------------------------------------
--- liquibase-maven-plugin:3.3.3:update (default-cli) # ********** ---
------------------------------------------------------------------------
Liquibase skipped due to maven configuration
------------------------------------------------------------------------
BUILD SUCCESS
This runs perfectly well if I revert to using version 2.0.5 of the liquibase plugin.
Can anyone enlighten me as to what I'm doing wrong?
Check here: CORE-2360
It looks like <skip> is set to true by default in 3.3.3 version. Just use 3.3.4 and it should be OK.

Unable to compile and create .avro file from .avsc using Maven

I'm new to Maven and have been looking at tutorials and web for documentation on how to build a .avro from a schema file .avsc. Based on the documentation that on the apache.maven.org site. I have to add the following
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.7.5</version>
</dependency>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.7.5</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
I've added the same into my POM.xml file. I have 2 schema files (.avsc) and following is my directory structure with contents
ProjectDir
src
main
java
avrò
abc.avsc
resources
test
pom.xml
My POM.xml is
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.training</groupId>
<artifactId>TestAvro</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TestAvro</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.basedir>/Users/vsank2/TestAvro</project.basedir>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-compiler</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.7.5</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
I executed the following
mvn clean generate-sources and I get the following output
INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestAvro 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # TestAvro ---
[INFO] Deleting /Users/vsank2/TestAvro/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.514s
[INFO] Finished at: Mon Dec 23 16:08:51 PST 2013
[INFO] Final Memory: 2M/81M
[INFO] ------------------------------------------------------------------------
Appreciate any help in this regard. thank you
After a lot of research I found that the problem was completely with my .avsc JSON problem. The "namespace" was totally wrong. As soon as I fixed it. The maven avro plugin created the java class from the schema.
First of it is not the JSON issue. Issue occurred due to addition of tag in t he pom.xml
Points to note :
defines the settings for plugins that will be inherited by child modules in your build. This tag is not required until it is parent POM.
i.e tag is used to manage plugin in child modules.
So no need to add the tag in pom.xml.
If there is any error "Plugin execution not covered by lifecycle configuration" then it is because of the older avro version try to look for latest version it will resolve the issue.
for anyone else that has has the issue.
Also if your configuration is being ignored then moving the configuration block under the plugin section works. It worked for me on the version 1.11.0. I found the fix in this stackoverflow.
Apache Avro maven plugin seems to be ignoring config
Also this github repo is very useful for testing out making a avro file in to java file. there is no custom configuration in it though which you can add yourself.
https://github.com/alexholmes/avro-maven
Also I found this command very useful for debugging f directories do not exist when it is producing the files. It tells you the exact problem.
mvn -X avro:schema

How to generate classes from wsdl using Maven and wsimport?

When I attempt to run "mvn generate-sources" this is my output :
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gensourcesfromwsdl 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.104s
[INFO] Finished at: Tue Aug 20 15:41:10 BST 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
I do not receive any errors but there are no java classes generated from the wsdl file.
Here is my pom.xml file that I'm running the plugin against :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gensourcesfromwsdl</groupId>
<artifactId>gensourcesfromwsdl</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlLocation>http://mysite/firstwsdl.asmx?wsdl</wsdlLocation>
<packageName>com</packageName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
What am I doing wrong ? The package com exists in the project 'gensourcesfromwsdl' and the wsdl location is valid.
When I run wsimport via the command line : >wsimport -keep -verbose http://mysite/firstwsdl.asmx?wsdl the class is generated.
To generate classes from WSDL, all you need is build-helper-maven-plugin and jaxws-maven-plugin in your pom.xml
Make sure you have placed wsdl under folder src/main/resources/wsdl and corresponding schema in src/main/resources/schema, run command "mvn generate-sources" from Project root directory.
C:/Project root directory > mvn generate-sources
generated java classes can be located under folder
target/generated/src/main/java/com/raps/code/generate/ws.
pom.xml snippet
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>${project.build.directory}/generated/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
<packageName>com.raps.code.generate.ws</packageName>
<keep>true</keep>
<sourceDestDir>${project.build.directory}/generated/src/main/java</sourceDestDir>
</configuration>
<executions>
<execution>
<id>myImport</id>
<goals><goal>wsimport</goal></goals>
</execution>
</executions>
</plugin>
Here is an example of how to generate classes from wsdl with jaxws maven plugin from a url or from a file location (from wsdl file location is commented).
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<build>
<plugins>
<!-- usage of jax-ws maven plugin-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>wsimport-from-jdk</id>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- using wsdl from an url -->
<wsdlUrls>
<wsdlUrl>
http://myWSDLurl?wsdl
</wsdlUrl>
</wsdlUrls>
<!-- or using wsdls file directory -->
<!-- <wsdlDirectory>src/wsdl</wsdlDirectory> -->
<!-- which wsdl file -->
<!-- <wsdlFiles> -->
<!-- <wsdlFile>myWSDL.wsdl</wsdlFile> -->
<!--</wsdlFiles> -->
<!-- Keep generated files -->
<keep>true</keep>
<!-- Package name -->
<packageName>com.organization.name</packageName>
<!-- generated source files destination-->
<sourceDestDir>target/generatedclasses</sourceDestDir>
</configuration>
</plugin>
</plugins>
</build>
Even though this is bit late response, may be helpful for someone. Look like you have used pluginManagement. If you use pluginManagement
, it will not pick the plug-in execution.
It should be under
<build>
<plugins>
<plugin>
Try to wrap wsdlLocation in wsdlUrls
<wsdlUrls>
<wsdlLocation>http://url</wsdlLocation>
</wsdlUrls>
I see some people prefer to generate sources into the target via jaxws-maven-plugin AND make this classes visible in source via build-helper-maven-plugin. As an argument for this structure
the version management system (svn/etc.) would always notice changed
sources
With git it is not true. So you can just configure jaxws-maven-plugin to put them into your sources, but not under the target folder. Next time you build your project, git will not mark these generated files as changed. Here is the simple solution with only one plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-fluent-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<packageName>som.path.generated</packageName>
<xjcArgs>
<xjcArg>-Xfluent-api</xjcArg>
</xjcArgs>
<verbose>true</verbose>
<keep>true</keep> <!--used by default-->
<sourceDestDir>${project.build.sourceDirectory}</sourceDestDir>
<wsdlDirectory>src/main/resources/META-INF/wsdl</wsdlDirectory>
<wsdlLocation>META-INF/wsdl/soap.wsdl</wsdlLocation>
</configuration>
</execution>
</executions>
</plugin>
Additionally (just to note) in this example SOAP classes are generated with Fluent API, so you can create them like:
A a = new A()
.withField1(value1)
.withField2(value2);
The key here is keep option of wsimport. And it is configured using element in
About keep from the wsimport documentation :
-keep keep generated files
i was having the same issue while generating the classes from wsimport goal. Instead of using jaxws:wsimport goal in eclipse Maven Build i was using clean compile install that was not able to generate code from wsdl file. Thanks to above example.
Run jaxws:wsimport goal from Eclipse ide and it will work

Maven test (webdriver/testng) looking for resources in non-existing folder. How can I tell it where to look for it?

I have created a selenium/webdriver testng test written in Java, using eclipse.
when I am in eclipse and I have currently selected the test case .class, I can run it and it opens up a browser and runs the test.
When I "mvn integration-test" it, an empty browser is opened and nothing happens. The error reads as follows
--- maven-resources-plugin:2.6:resources (default-resources) # functionalTests ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory c:\test2\functionalTests\src\main\resources
--- maven-compiler-plugin:2.5.1:compile (default-compile) # functionalTests ---
Nothing to compile - all classes are up to date
--- maven-resources-plugin:2.6:testResources (default-testResources) # functionalTests ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory c:\test2\functionalTests\src\test\resources
I really dont have such folder. I generated the maven project, using some archetype I found on the internet and I just replaced their class with mine.
Here is my folder structure:
src
-main
--java
---com
----pragmaticqa
-----tests
test
-java
--com
---pragmaticqa
----tests
and inside tests is where my test .class is located.
this is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pragmaticqa.tests</groupId>
<artifactId>functionalTests</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>functionalTests</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.32.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>xvfb</id>
<phase>pre-integration-test</phase>
<goals>
<goal>xvfb</goal>
</goals>
</execution>
<execution>
<id>selenium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
So my question is - how do I tell maven where to look for the test to run?
Add a surefire plugin like the one shown below. Instead of specify your test class name
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</plugin>

liquibase plugin errors using maven

Hi i'm new to liquibase , and i'm importing an existing project after compile it i get this build failure , i can't understand the cause and the solution i'm trying to understand the code but i really find problem to do it .
this is the result after running mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.squashtest.tm:squashtest-csp-distribution:pom:1.2.0.RELEASE
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:org.squashtest.csp.core.log4j:jar -> duplicate declaration of version ${project.version} # line 419, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:org.squashtest.csp.core.jetty.start.osgi:jar -> duplicate declaration of version ${project.version} # line 424, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:org.squashtest.csp.core.service:jar -> duplicate declaration of version ${project.version} # line 450, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:squashtest-csp-launcher:jar -> duplicate declaration of version ${project.version} # line 455, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:org.squashtest.csp.tm.web:war -> duplicate declaration of version ${project.version} # line 461, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ${project.groupId}:org.squashtest.csp.tm.service:jar -> duplicate declaration of version ${project.version} # line 467, column 17
[WARNING] 'profiles.profile[build-mysql].plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.codehaus.mojo:sql-maven-plugin # line 682, column 15
[WARNING] 'profiles.profile[build-mysql].plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.liquibase:liquibase-maven-plugin # line 724, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building squashtest-tm-distribution 1.2.0.RELEASE
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.izpack:izpack-maven-plugin:1.0-alpha-5: Plugin org.codehaus.izpack:izpack-maven-plugin:1.0-alpha-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.izpack:izpack-maven-plugin:jar:1.0-alpha-5
[INFO]
[INFO] --- liquibase-maven-plugin:2.0.1:update (default-cli) # squashtest-csp-distribution ---
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:12.500s
[INFO] Finished at: Fri Jul 13 10:25:08 GMT+01:00 2012
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0.1:update (default-cli) on project squashtest-csp-distribution: The driver has not been specified either as a parameter or in a properties file. -> [Help 1]**
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Here's the pom.xml liquibase part :
<!-- We first run a full install against MySQL -->
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<configuration>
<skip>${mysql.distro.skip}</skip>
</configuration>
<executions>
<execution>
<id>generate-mysql-full-install-script</id>
<phase>process-resources</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>true</dropFirst>
<changeLogFile>${master.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-full-install-
version-${project.version}.sql</migrationSqlOutputFile>
</configuration>
</execution>
</executions>
</plugin>
<!-- We now run an incremental install against MySQL -->
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<configuration>
<skip>${mysql.distro.skip}</skip>
</configuration>
<executions>
<execution>
<id>generate-mysql-0.15.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>true</dropFirst>
<changeLogFile>${upgrade.0.15.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-0.15.0.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-0.17.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.0.17.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-0.17.0.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-0.20.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.0.20.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-0.20.0.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-0.23.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.0.23.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-0.23.0.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-1.1.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.1.1.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-1.1.0.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-1.1.1-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.1.1.1.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-1.1.1.sql</migrationSqlOutputFile>
</configuration>
</execution>
<execution>
<id>generate-mysql-1.2.0-script</id>
<phase>prepare-package</phase>
<goals>
<goal>updateSQL</goal>
</goals>
<configuration>
<dropFirst>false</dropFirst>
<changeLogFile>${upgrade.1.2.0.changelog}</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>${liquibase.mysql.url}</url>
<username>${liquibase.mysql.username}</username>
<password>${liquibase.mysql.password}</password>
<migrationSqlOutputFile>${database.script.directory}/mysql-upgrade-
to-${squashTmVersion}.sql</migrationSqlOutputFile>
</configuration>
</execution>
</executions>
</plugin>
You receive this error because the value of the url is provided by a maven property, referred as ${liquibase.mysql.url}
You can set the value for maven properties in your pom like:
<project>
[...]
<properties>
<liquibase.mysql.url>jdbc:mysql://127.0.0.1:3306</liquibase.mysql.url>
<liquibase.mysql.username>someuser</liquibase.mysql.username>
[...]
</properties>
[...]
The liquibase plugin also provides possibility to read the configuration properties from a property file e.g. src/main/resources/liquibase.properties
If you choose this, you need to configure the liquibase maven plugin by replacing the conofiguration section in the pom like:
[...]
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
</configuration>
[...]
Then the liquibase properties should look like
url=jdbc:mysql://127.0.0.1:3306
username=someuser
dropFirst=true
changeLogFile=yourfile
[...]
More information is here: http://www.liquibase.org/documentation/maven/index.html#using_configuration_property_files
You need to set your variables ${liquabase.mysql.url} and so forth in your .m2/settings.xml. More details here: Missing maven .m2 folder
You also need to run mvn liquibase:update
First of all you are using a phase process-resource, which is basically used when you want to work on your changeLog from the output target directories, and if you are trying to use the filtering in your resource files using maven resource filtering plugin.
And I don't know for what purpose you are actually using the prepare-package or any such phase multiple times, maven with liquibase is not setup like this, you should have one master changelog, which should include your other upgrades, with some preCondition checks in each of your upgrades.
Your directory structure should be something like following, if you want to use your process-resource phase, and intended to do some kind of filtering in resource files.
src/
`-- main
|-- java
`-- resources
|-- changelog-1.0.0.xml
|-- changelog-1.1.0.xml
|-- changelog-install.xml
|-- com
| `-- obolus
| `-- database
| `-- changelog
| |-- v000
| | |-- cst
| | | |-- entity_extra_data.xml
| | | `-- entity.xml
| | |-- master.xml
| | `-- tab
| | |-- company.xml
| | |-- entity_extra_data.xml
| | |-- entity.xml
| | `-- anothertable.xml
| `-- v001
| |-- master.xml
| `-- tab
| `-- sample.xml
|-- lib
| |-- ojdbc6-11.2.0.3.jar
`-- liquibase.properties
Example of POM file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.obolus</groupId>
<artifactId>database</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.maven.plugin}</version>
<configuration>
<changeLogFile>target/classes/changelog-install.xml</changeLogFile
<propertyFile>target/classes/liquibase.properties</propertyFile>
<logging>${logLevel}</logging>
</configuration>
<executions>
<execution>
<goals>
<goal>status</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- resource filtering -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>${ojdbc.driver.version}</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<ojdbc.driver.version>11.2.0.3</ojdbc.driver.version>
<liquibase.maven.plugin>3.3.2</liquibase.maven.plugin>
<logLevel>severe</logLevel>
</properties>
</project>
Hope that helps.

Resources