maven-invoker doesn't call install on dependency - maven

i have a problem in my maven build process. there is a pom file which uses the maven-invoker-plugin to execute different tasks:
<execution>
<id>createWebstartApps</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<projectsDirectory>.</projectsDirectory>
<streamLogs>true</streamLogs>
<pomIncludes>
<pomInclude>pom1.xml</pomInclude>
</pomIncludes>
....
but when i use the maven release plugin "mvn release:prepare" the install goal will not be executed on the child pom dependencies. For example the pom1.xml has the following dependency:
<dependency>
<groupId>com.qnamic.dis</groupId>
<artifactId>DisAdminToolWithPlugins</artifactId>
<version>${project.parent.version}</version>
<type>pom</type>
<scope>runtime</scope>
.....
But this dependency (in this case the pom file) will not be installed in my local maven repo and therefore not be found:
[INFO] [INFO] Building: pomWebstartDisAdminTool.xml
[INFO] [INFO] [INFO] Scanning for projects...
[INFO] [INFO] [INFO]
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] Building RailOpt DIS Admin Tool 4.9.12
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [WARNING] The POM for com.qnamic.dis:DisAdminToolWithPlugins:pom:4.9.12 is missing, no dependency information available
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] BUILD FAILURE
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] Total time: 0.203s
[INFO] [INFO] [INFO] Finished at: Tue Feb 05 13:00:04 CET 2013
[INFO] [INFO] [INFO] Final Memory: 4M/15M
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [ERROR] Failed to execute goal on project DisAdminToolWebstart: Could not resolve dependencies for project com.qnamic.dis:DisAdminToolWebstart:pom:4.9.12: Failure to find com.qnamic.dis:DisAdminToolWithPlugins:pom:4.9.12 in http://maven.ad.bls.ch/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of bls-public has elapsed or updates are forced -> [Help 1]
any ideas?
regards

Try adding install before run. Eg.
<execution>
<id>createWebstartApps</id>
<phase>process-resources</phase>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
...
For more information: http://maven.apache.org/plugins/maven-invoker-plugin/install-mojo.html & http://maven.apache.org/plugins/maven-invoker-plugin/usage.html
HTH,
Jamie

Add the file invoker.properties next to your pom.xml
and put your goals into it, like:
invoker.goals = clean install

Related

Raster layer - Geotools: java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO

Here is what i got back when i run the mvn command regarding the dependencies. The main problem as i explained before is that the imageIO lib is not working when i am trying to run the jar file outside IDE. I would like to point out that all the other functionalities are working properly. Do you have any idea of how to solve this problem? I have also try to follow the steps in this link: http://docs.geotools.org/latest/userguide/build/install/jdk.html but i got back the same error.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gisLaraMaven gis
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.geotools:gt-wfs:jar:20.1 is missing, no dependency information available
[INFO]
[INFO] --- maven-dependency-plugin:2.1:list (default-cli) # gis ---
[INFO]
[INFO] The following files have been resolved:
[INFO] com.conversantmedia:disruptor:jar:1.2.13:compile
[INFO] com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] com.google.errorprone:error_prone_annotations:jar:2.2.0:compile
[INFO] com.google.guava:failureaccess:jar:1.0:compile
[INFO] com.google.guava:guava:jar:27.0-jre:compile
[INFO] com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] com.miglayout:miglayout:jar:swing:3.7:compile
[INFO] com.vividsolutions:jts:jar:1.13:compile
[INFO] commons-codec:commons-codec:jar:1.2:compile
[INFO] commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] commons-io:commons-io:jar:2.6:compile
[INFO] commons-logging:commons-logging:jar:1.0.4:compile
[INFO] commons-pool:commons-pool:jar:1.5.4:compile
[INFO] hsqldb:hsqldb:jar:1.8.0.7:compile
[INFO] it.geosolutions.imageio-ext:imageio-ext-geocore:jar:1.1.27:compile
[INFO] it.geosolutions.imageio-ext:imageio-ext-streams:jar:1.1.27:compile
[INFO] it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.27:compile
[INFO] it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.27:compile
[INFO] it.geosolutions.jaiext.affine:jt-affine:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.algebra:jt-algebra:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.bandcombine:jt-bandcombine:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.bandmerge:jt-bandmerge:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.bandselect:jt-bandselect:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.binarize:jt-binarize:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.border:jt-border:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.buffer:jt-buffer:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.classifier:jt-classifier:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.colorconvert:jt-colorconvert:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.colorindexer:jt-colorindexer:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.crop:jt-crop:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.errordiffusion:jt-errordiffusion:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.format:jt-format:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.imagefunction:jt-imagefunction:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.iterators:jt-iterators:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.lookup:jt-lookup:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.mosaic:jt-mosaic:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.nullop:jt-nullop:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.orderdither:jt-orderdither:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.piecewise:jt-piecewise:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.rescale:jt-rescale:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.rlookup:jt-rlookup:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.scale:jt-scale:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.scale2:jt-scale2:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.shadedrelief:jt-shadedrelief:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.stats:jt-stats:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.translate:jt-translate:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.utilities:jt-utilities:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.vectorbin:jt-vectorbin:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.warp:jt-warp:jar:1.1.3:compile
[INFO] it.geosolutions.jaiext.zonal:jt-zonal:jar:1.1.3:compile
[INFO] javax.measure:unit-api:jar:1.0:compile
[INFO] javax.media:jai_codec:jar:1.1.3:compile
[INFO] javax.media:jai_core:jar:1.1.3:compile
[INFO] javax.media:jai_imageio:jar:1.1:compile
[INFO] jgridshift:jgridshift:jar:1.0:compile
[INFO] junit:junit:jar:3.8.1:test
[INFO] net.sf.geographiclib:GeographicLib-Java:jar:1.49:compile
[INFO] org.apache.xml:xml-commons-resolver:jar:1.2:compile
[INFO] org.checkerframework:checker-qual:jar:2.5.2:compile
[INFO] org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:compile
[INFO] org.ejml:ejml-core:jar:0.34:compile
[INFO] org.ejml:ejml-ddense:jar:0.34:compile
[INFO] org.geotools:gt-api:jar:20.1:compile
[INFO] org.geotools:gt-coverage:jar:20.1:compile
[INFO] org.geotools:gt-cql:jar:20.1:compile
[INFO] org.geotools:gt-data:jar:20.1:compile
[INFO] org.geotools:gt-epsg-hsql:jar:20.1:compile
[INFO] org.geotools:gt-geotiff:jar:20.1:compile
[INFO] org.geotools:gt-image:jar:20.1:compile
[INFO] org.geotools:gt-main:jar:20.1:compile
[INFO] org.geotools:gt-metadata:jar:20.1:compile
[INFO] org.geotools:gt-opengis:jar:20.1:compile
[INFO] org.geotools:gt-process:jar:20.1:compile
[INFO] org.geotools:gt-referencing:jar:20.1:compile
[INFO] org.geotools:gt-render:jar:20.1:compile
[INFO] org.geotools:gt-shapefile:jar:20.1:compile
[INFO] org.geotools:gt-swing:jar:20.1:compile
[INFO] org.geotools:gt-wfs:jar:20.1:compile
[INFO] org.geotools:gt-wms:jar:20.1:compile
[INFO] org.geotools:gt-xml:jar:20.1:compile
[INFO] org.hsqldb:hsqldb:jar:2.4.1:compile
[INFO] org.jaitools:jt-utils:jar:1.5.0:compile
[INFO] org.jaitools:jt-zonalstats:jar:1.5.0:compile
[INFO] org.jdom:jdom2:jar:2.0.6:compile
[INFO] org.locationtech.jts:jts-core:jar:1.16.0:compile
[INFO] org.postgresql:postgresql:jar:9.4-1202-jdbc42:compile
[INFO] org.slf4j:slf4j-api:jar:1.7.13:compile
[INFO] si.uom:si-quantity:jar:0.7.1:compile
[INFO] si.uom:si-units-java8:jar:0.7.1:compile
[INFO] systems.uom:systems-common-java8:jar:0.7.2:compile
[INFO] tec.uom:uom-se:jar:1.0.8:compile
[INFO] tec.uom.lib:uom-lib-common:jar:1.0.2:compile
[INFO] xerces:xercesImpl:jar:2.11.0:compile
[INFO] xml-apis:xml-apis:jar:1.4.01:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.701s
[INFO] Finished at: Wed Apr 03 18:37:35 EEST 2019
[INFO] Final Memory: 12M/243M
[INFO] ------------------------------------------------------------------------
And here is the part of the pom.xml which is the maven shade plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- This bit sets the main class for
the executable jar as you otherwise -->
<!-- would with the assembly plugin
-->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.mycompany.gislaramaven.gisMap_3</Main-Class>
</manifestEntries>
</transformer>
<!-- This bit merges the various
GeoTools META-INF/services files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Specification-Vendor>Sun Microsystems, Inc</Specification-Vendor>
<Implementation-Vendor>Sun Microsystems, Inc</Implementation-Vendor>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
The new error that i am getting back is given below. It seems that again something is missing related to the JAI lib. Please have a look:
WARNING The input argument(s) may not be null.
java.lang.IllegalArgumentException: The input argument(s) may not be null.
at javax.media.jai.ParameterBlockJAI.getDefaultMode(ParameterBlockJAI.java:136)
at javax.media.jai.ParameterBlockJAI.<init>(ParameterBlockJAI.java:157)
at javax.media.jai.ParameterBlockJAI.<init>(ParameterBlockJAI.java:178)
at it.geosolutions.jaiext.vectorbin.ROIGeometry.getAsImage(ROIGeometry.java:473)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.addRoiIfMissing(GridCoverageRenderer.java:1095)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.reproject(GridCoverageRenderer.java:509)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:958)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:1279)
at org.geotools.renderer.lite.StreamingRenderer$RenderCoverageReaderRequest.execute(StreamingRenderer.java:3650)
at org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3744)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
You need to add ImageIO to your manifestEntries using something like:
<transformers>
<!-- This bit sets the main class for the executable jar as you otherwise -->
<!-- would with the assembly plugin -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.ianturton.tileviewer.TileViewer</Main-Class>
<Specification-Title> Java Advanced Imaging Image I/O Tools</Specification-Title>
<Specification-Version>1.1</Specification-Version>
<Specification-Vendor> Sun Microsystems, Inc. </Specification-Vendor>
<Implementation-Title> com.sun.media.imageio</Implementation-Title>
<Implementation-Version> 1.1</Implementation-Version>
<Implementation-Vendor> Sun Microsystems, Inc.</Implementation-Vendor>
</manifestEntries>
</transformer>
<!-- This bit merges the various GeoTools META-INF/services files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
You probably have not build a fat jar.
If you just build a jar, dependencies are not included, so running the jar outside the IDE will usually result in missing classes.
You can use the maven assembly plugin or maven shade plugin to generate a fat jar.

Maven 2 & 3 differences on dependency:analyze with cycle

Here's the dependency tree I'm using:
[INFO] ------------------------------------------------------------------------
[INFO] Building PA 0.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # PA ---
[INFO] myTest:PA:jar:0.0.2-SNAPSHOT
[INFO] \- PC:PC:jar:0.0.1-SNAPSHOT:compile
[INFO] \- myTest:PA:jar:0.0.1-SNAPSHOT:compile
As you can see, there's a cycle :
PA > PC > PA
Using maven 2.2.1:
mvn dependency:analyze
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - myTest:PA:jar:0.0.2-SNAPSHOT
[INFO] task-segment: [dependency:analyze]
[INFO] ------------------------------------------------------------------------
...
[INFO] No dependency problems found
Using maven 3.3.3:
mvn dependency:analyze
[INFO] ------------------------------------------------------------------------
[INFO] Building PA 0.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
[INFO] --- maven-dependency-plugin:2.8:analyze (default-cli) # PA ---
[WARNING] Used undeclared dependencies found:
[WARNING] myTest:PA:jar:0.0.1-SNAPSHOT:compile
The analyze using maven 3 wants me to add PA as a dependency to PA, to itself. Is it possible to have the same behavior as maven 2 using maven 3?
Here's the workaround I'm using to have the same result as Maven 2 using Maven 3:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<ignoredDependencie>${project.groupId}:${project.artifactId}::</ignoredDependencie>
</ignoredDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

Maven is not downloading a plugin : jetspeed-unpack-maven-plugin

so I made this pom :
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.mssb.ocr</groupId>
<artifactId>tesseractOcr</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<build>
<plugins>
<!-- autorun unit tests during maven compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<argLine>-Xmx1024m -XX:MaxPermSize=256m -XX:-UseSplitVerifier</argLine>
<skipTests>-DskipTests</skipTests>
</configuration>
</plugin>
<!--
this extract the 32 bits dll and the tesseractdata folder to
the project root from tess4j.jar
-->
<plugin>
<groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed-unpack-maven-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<unpack>
<artifact>net.sourceforge.tess4j:tess4j:jar</artifact>
<overwrite>true</overwrite>
<resources combine.children="append">
<resource>
<path>win32-x86</path>
<destination>${basedir}</destination>
<overwrite>true</overwrite>
<flat>true</flat>
<include>*</include>
</resource>
<resource>
<path>tessdata</path>
<destination>${basedir}</destination>
<overwrite>true</overwrite>
<flat>false</flat>
<include>*</include>
</resource>
</resources>
</unpack>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!--
Log4j 2 is broken up in an API and an implementation (core), where the API
provides the interface that applications should code to. Strictly speaking
Log4j core is only needed at runtime and not at compile time.
However, below we list Log4j core as a compile time dependency to improve
the startup time for custom plugins.
-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.1</version>
</dependency>
<!--
Integration of tesseract OCR
-->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
mvn clean install and eclipse:eclipse both end up in a "SUCCESS" however the jeetspeed plugin does nothing, I don't see him doing anything in the console when building and he his not even in my local repository.
Yes, I added maven central to my maven conf file (http://repo1.maven.org/maven2/)
I'm using maven 3.2.1
What could I do?
Thanks
EDIT
mvn clean install
D:\!2015 repo\TTsXXJava>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] capcha solver
[INFO] tesseract ocr project
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building capcha solver 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # parent ---
[INFO] Deleting D:\!2015 repo\TTsXXJava\target
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # parent ---
[INFO] Installing D:\!2015 repo\TTsXXJava\pom.xml to d:\.m2\fr\mssb\capcha\parent\1.0\parent-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tesseract ocr project 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # tesseractOcr ---
[INFO] Deleting D:\!2015 repo\TTsXXJava\capcha-solver\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # tesseractOcr ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # tesseractOcr ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\!2015 repo\TTsXXJava\capcha-solver\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # tesseractOcr ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # tesseractOcr ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # tesseractOcr ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # tesseractOcr ---
[INFO] Building jar: D:\!2015 repo\TTsXXJava\capcha-solver\target\tesseractOcr-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # tesseractOcr ---
[INFO] Installing D:\!2015 repo\TTsXXJava\capcha-solver\target\tesseractOcr-1.0.jar to d:\.m2\fr\mssb\capcha\tesseractOcr\1.0\tesseractOcr-1.0.jar
[INFO] Installing D:\!2015 repo\TTsXXJava\capcha-solver\pom.xml to d:\.m2\fr\mssb\capcha\tesseractOcr\1.0\tesseractOcr-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] capcha solver ..................................... SUCCESS [ 0.381 s]
[INFO] tesseract ocr project ............................. SUCCESS [ 1.910 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.424 s
[INFO] Finished at: 2015-02-05T12:52:22+01:00
[INFO] Final Memory: 14M/231M
[INFO] ------------------------------------------------------------------------
mvn eclipse:eclipse
$ mvn eclipse:eclipse
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] capcha solver
[INFO] tesseract ocr project
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building capcha solver 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-eclipse-plugin:2.5.1:eclipse (default-cli) # parent >>>
[INFO]
[INFO] <<< maven-eclipse-plugin:2.5.1:eclipse (default-cli) # parent <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.5.1:eclipse (default-cli) # parent ---
[INFO] Not running eclipse plugin goal for pom project
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tesseract ocr project 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-eclipse-plugin:2.5.1:eclipse (default-cli) # tesseractOcr >>>
[INFO]
[INFO] <<< maven-eclipse-plugin:2.5.1:eclipse (default-cli) # tesseractOcr <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.5.1:eclipse (default-cli) # tesseractOcr ---
[INFO] Using as WTP server : null
[INFO] Using source status cache: D:\!2015 repo\TTsXXJava\target\mvn-eclipse-cache.properties
[INFO] File D:\!2015 repo\TTsXXJava\capcha-solver\.project already exists.
Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed.
[INFO] Wrote Eclipse project for "tesseractOcr" to D:\!2015 repo\TTsXXJava\capcha-solver.
[INFO]
Javadoc for some artifacts is not available.
List of artifacts without a javadoc archive:
o com.sun.jna:jna:3.0.9
o net.java.dev.jai-imageio:jai-imageio-core-standalone:1.2-pre-dr-b04-2011-07-04
o log4j:log4j:1.2.15
o commons-io:commons-io:1.3.1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] capcha solver ..................................... SUCCESS [ 0.962 s]
[INFO] tesseract ocr project ............................. SUCCESS [ 0.406 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.698 s
[INFO] Finished at: 2015-02-05T12:42:36+01:00
[INFO] Final Memory: 7M/183M
[INFO] ------------------------------------------------------------------------
Parent pom in case you need it (I remove the parent reference in the originaly posted pom)
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.mssb.capcha</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>capcha solver</name>
<modules>
<module>capcha-solver</module>
</modules>
<build>
<plugins>
<!-- All project will be interpreted (source) and compiled (target) in java 7 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- this will make eclipse:eclipse goal work and make the project Eclipse compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</classpathContainer>
</classpathContainers>
<additionalBuildcommands>
<buildcommand>net.sf.eclipsecs.core.CheckstyleBuilder</buildcommand>
</additionalBuildcommands>
<additionalProjectnatures>
<projectnature>net.sf.eclipsecs.core.CheckstyleNature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
</plugins>
</build>
</project>
It is not doing anything because you have not bound any execution of the plugin to a lifecycle phase. You need to add a block like this:
<plugin>
<executions>
<execution>
<id>unpack-step</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
...
</configuration>
</executions>
</plugin>
See http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference for the possible lifecycle phases you can use.

2 exec-maven-plugin defined in POM - not working

I have two Java main classes that I need executed during different parts of a build process. One needs to execute ALWAYS as part of my standard build process during the generate-sources phase. The other needs to execute as part of a profile, but that profile should be execute at the end of the process-classes phase, which should also include the generate-sources phase prior to that.
I was able to get the first plugin working correctly during the generate-sources phase of the standard build process:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.example.MySourceGenerator</mainClass>
</configuration>
</plugin>
However when I added a second instance of the same plugin to the profile, the plugin defined as part of the standard build is no longer invoked during my build process, resulting in compile errors. This is the configuration in the profile:
<profiles>
<profile>
<id>initSchema</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.example.SomeOtherClass</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
This is what I run on the command line: mvn process-classes -PinitSchema. What is wrong with my configuration? I am expecting both plugins to execute during their respective phases.
To clarify: the first exec-maven-plugin generates sources and the second one initialized my DB schema.
EDIT:
Here is the output
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ABC Web Application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) # web-app ---
[INFO] Source directory: /Users/wendyschmitz/projects/ae/abc-proj/web-app/target/generated-sources/msg added.
[INFO]
[INFO] --- maven-processor-plugin:2.0.6:process (process) # web-app ---
[INFO] Source directory: /Users/wendyschmitz/projects/ae/abc-proj/web-app/target/generated-sources/apt added
[INFO] javac option: -cp
...
[INFO] javac option: -proc:only
[INFO] javac option: -processor
[INFO] javac option: com.company.vocab.generator.VocabAnnotationProcessor,org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
[INFO] javac option: -d
[INFO] javac option: /Users/wendyschmitz/projects/ae/abc-proj/web-app/target/classes
[INFO] javac option: -s
[INFO] javac option: /Users/wendyschmitz/projects/ae/abc-proj/web-app/target/generated-sources/apt
[INFO] diagnostic Note: Hibernate JPA 2 Static-Metamodel Generator 1.2.0.Final
[INFO] diagnostic /Users/wendyschmitz/projects/ae/abc-proj/web-app/src/main/java/com/company/service/dto/AccountDto.java:5: error: cannot find symbol
import com.telos.xacta.util.Messages;
...
(more similar messages)
[INFO]
[INFO] --- jaxb2-maven-plugin:1.5:xjc (default) # web-app ---
[INFO] Generating source...
[INFO] parsing a schema...
[INFO] compiling a schema...
...
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # web-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # web-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 281 source files to /Users/wendyschmitz/projects/ae/abc-proj/web-app/target/classes
[INFO] -------------------------------------------------------------
...
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/wendyschmitz/projects/ae/abc-proj/web-app/src/main/java/com/company/service/dto/ProjectHeadDto.java:[4,28] cannot find symbol
symbol: class Messages
location: package com.company.util
...
(more similar errors)
...
[INFO] 29 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.817s
[INFO] Finished at: Thu Aug 01 20:49:07 EDT 2013
[INFO] Final Memory: 31M/282M
[INFO] ------------------------------------------------------------------------
Give both the execution blocks a different id, because now they both use the default id and so one will overwrite the other.

Maven release does not work with a grouping pom

I want to release a project with the following structre (simplified):
parent
--module A (packaging type: pom)
--module B (type jar)
--module C (type jar, uses A and B as dependency)
I want to release my project with the help of Jenkins. A build works fine.
But for the release it seems that there will not be a version of the pom-typed project in the reactor. The build failed because no version of the pom-type project can be found in my maven repository. With the dependency of type jar everything works well.
Can anybody help me?
here you can see the console out out and my test pom-files:
[INFO] [release:prepare {execution: default-cli}]
[INFO] Verifying that there are no local modifications...
[INFO] Executing: /bin/sh -c cd /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace && git status
[INFO] Working directory: /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] Transforming 'Unnamed - com.basfits.test:parentTest:pom:0.0.2-SNAPSHOT'...
[INFO] Transforming 'Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2-SNAPSHOT'...
[INFO] Transforming 'Unnamed - com.basfits.test:testjarDep:jar:0.0.2-SNAPSHOT'...
[INFO] Transforming 'Unnamed - com.basfits.test:testPomDep:jar:0.0.2-SNAPSHOT'...
[INFO] Updating testjarDep to 0.0.2
[INFO] Updating childTestSimplePom to 0.0.2
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] Reactor build order:
[INFO] [INFO] Unnamed - com.basfits.test:parentTest:pom:0.0.2
[INFO] [INFO] Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2
[INFO] [INFO] Unnamed - com.basfits.test:testjarDep:jar:0.0.2
[INFO] [INFO] Unnamed - com.basfits.test:testPomDep:jar:0.0.2
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Unnamed - com.basfits.test:parentTest:pom:0.0.2
[INFO] [INFO] task-segment: [clean, verify]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [clean:clean {execution: default-clean}]
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2
[INFO] [INFO] task-segment: [clean, verify]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [clean:clean {execution: default-clean}]
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Unnamed - com.basfits.test:testjarDep:jar:0.0.2
[INFO] [INFO] task-segment: [clean, verify]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [clean:clean {execution: default-clean}]
[INFO] [INFO] [resources:resources {execution: default-resources}]
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/src/main/resources
[INFO] [INFO] [compiler:compile {execution: default-compile}]
[INFO] [INFO] Compiling 1 source file to /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/target/classes
[INFO] [INFO] [resources:testResources {execution: default-testResources}]
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/src/test/resources
[INFO] [INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] [INFO] No sources to compile
[INFO] [INFO] [surefire:test {execution: default-test}]
[INFO] [INFO] No tests to run.
[INFO] [INFO] [jar:jar {execution: default-jar}]
[INFO] [INFO] Building jar: /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/target/testjarDep-0.0.2.jar
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Unnamed - com.basfits.test:testPomDep:jar:0.0.2
[INFO] [INFO] task-segment: [clean, verify]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [clean:clean {execution: default-clean}]
[INFO] [INFO] Deleting directory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testPomDep/target
[INFO] [INFO] [resources:resources {execution: default-resources}]
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testPomDep/src/main/resources
[INFO] Downloading: http://maven.bcs.de/content/repositories/bis-releases/com/basfits/test/childTestSimplePom/0.0.2/childTestSimplePom-0.0.2.pom
[INFO] [INFO] Unable to find resource 'com.basfits.test:childTestSimplePom:pom:0.0.2' in repository bis-releases (http://maven.bcs.de/content/repositories/bis-releases)
[INFO] Downloading: http://maven.bcs.de/content/groups/public/com/basfits/test/childTestSimplePom/0.0.2/childTestSimplePom-0.0.2.pom
[INFO] [INFO] Unable to find resource 'com.basfits.test:childTestSimplePom:pom:0.0.2' in repository central (http://repo1.maven.org/maven2)
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Failed to resolve artifact.
[INFO]
[INFO] Missing:
[INFO] ----------
[INFO] 1) com.basfits.test:childTestSimplePom:pom:0.0.2
[INFO] Path to dependency:
[INFO] 1) com.basfits.test:testPomDep:jar:0.0.2
[INFO] 2) com.basfits.test:childTestSimplePom:pom:0.0.2
[INFO]
[INFO] ----------
[INFO] 1 required artifact is missing.
[INFO]
[INFO] for artifact:
[INFO] com.basfits.test:testPomDep:jar:0.0.2
[INFO]
[INFO] from the specified remote repositories:
[INFO] nexus-central (http://maven.bcs.de/content/groups/public),
[INFO] bis-releases (http://maven.bcs.de/content/repositories/bis-releases),
[INFO] bis-snapshots (http://maven.bcs.de/content/repositories/bis-snapshots)
[INFO]
[INFO]
[INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] For more information, run Maven with the -e switch
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 3 seconds
[INFO] [INFO] Finished at: Fri Jun 08 13:43:48 CEST 2012
[INFO] [INFO] Final Memory: 21M/271M
[INFO] [INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/pom.xml to /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/modules/com.basfits.test$parentTest/builds/2012-06-08_13-43-09/archive/com.basfits.test/parentTest/0.0.2-SNAPSHOT/parentTest-0.0.2-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
<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.basfits.test</groupId>
<artifactId>parentTest</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<build />
<scm>
<connection>...</connection>
<url>...</url>
</scm>
<distributionManagement>
<repository>
<id>bis-releases</id>
<name>BIS Releases</name>
<url>...</url>
</repository>
<snapshotRepository>
<id>bis-snapshots</id>
<name>BIS Snapshots</name>
<url>...</url>
</snapshotRepository>
</distributionManagement>
<modules>
<module>childTestSimplePom</module>
<module>testPomDep</module>
<module>testjarDep</module>
</modules>
<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>
<parent>
<artifactId>parentTest</artifactId>
<groupId>com.basfits.test</groupId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>childTestSimplePom</artifactId>
<packaging>pom</packaging>
<build />
<dependencies>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>
<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>
<parent>
<artifactId>parentTest</artifactId>
<groupId>com.basfits.test</groupId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>testPomDep</artifactId>
<build />
<dependencies>
<dependency>
<artifactId>testjarDep</artifactId>
<version>0.0.2-SNAPSHOT</version>
<groupId>com.basfits.test</groupId>
</dependency>
<dependency>
<artifactId>childTestSimplePom</artifactId>
<version>0.0.2-SNAPSHOT</version>
<groupId>com.basfits.test</groupId>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
You can set the preparation goals to clean install (default is clean verify). Add this in your grouping pom:
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<preparationGoals>clean install</preparationGoals>
</configuration>
</plugin>
<plugins>
<build>
This will install the released pom.xml into your local repository so your submodules can find it.

Resources