Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute - maven

I am trying to compile the code of georchestra 13.09 and it was working fine for some time but now i can't compile the code
I run the next code ./mvn clean install -Dmaven.test.skip=true -Dserver=MyServer and the error is the next
The maven version is the next
Apache Maven 3.0.3 (r1075438; 2011-02-28 13:31:09-0400)
Maven home: /opt/georchestra/build-tools/maven
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: es_ES, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-52-generic", arch: "amd64", family: "unix"
when i run ./mvn clean install -e -X -Dmaven.test.skip=true -Dserver=MyServer is the next
[INFO] ArcSDE module (dummy-api) ......................... SUCCESS [2.602s]
[INFO] GeoNetwork web client module ...................... FAILURE [22.586s]
[INFO] GeoNetwork Web module ............................. SKIPPED
[INFO] Download form webapp .............................. SKIPPED
[INFO] Analytics webapp .................................. SKIPPED
[ERROR] Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute (create-missingpost-treatment) on project geonetwork-client: Execution create-missingpost-treatment of goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute failed: Plugin org.codehaus.groovy.maven:gmaven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute (create-missingpost-treatment) on project geonetwork-client: Execution create-missingpost-treatment of goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute failed: Plugin org.codehaus.groovy.maven:gmaven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution create-missingpost-treatment of goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute failed: Plugin org.codehaus.groovy.maven:gmaven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:82)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.groovy.maven:gmaven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:215)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:353)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:321)
at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:175)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:78)
... 20 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:207)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.georchestra:config:jar:13.09 in Maven2 (http://repo1.maven.org/maven2/)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:945)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460)
... 27 more
[ERROR]
[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/PluginResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :geonetwork-client
I try fixing whit these post Maven Failed to Find dependency and none of the answers worked for me
mi pom.xml file is the next
<?xml version="1.0"?>
<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>org.georchestra</groupId>
<artifactId>root</artifactId>
<packaging>pom</packaging>
<version>14.06-SNAPSHOT</version>
<name>Root project of the geOrchestra project</name>
<url>http://maven.apache.org</url>
<organization>
<name>geOrchestra</name>
</organization>
<properties>
<gt.version>9.2</gt.version>
<spring.version>2.5.6.SEC01</spring.version>
<security.version>2.0.5.RELEASE</security.version>
<spring.ldap.version>1.3.0.RELEASE</spring.ldap.version>
<server>template</server>
<sub.target>dev</sub.target>
<!-- default when building without a profile specified -->
<confdir>${project.build.directory}/conf</confdir>
<encoding>UTF-8</encoding>
<georchestra.version>${project.version}</georchestra.version>
<postTreatmentScript><![CDATA[
def server=project.properties['server']
def subTarget=project.properties['subTarget']
def params = new Parameters(
project: project,
target: server,
subTarget: subTarget,
log: log,
ant: ant
)
params.init(false)
new PostTreatment().run(this, log, ant, project.basedir, params.projectDir, server, subTarget, project.build.directory)
]]></postTreatmentScript>
</properties>
<modules>
<module>geotools</module>
<module>config</module>
<module>header</module>
<module>epsg-extension</module>
<module>ogc-server-statistics</module>
<module>server-deploy-support</module>
</modules>
<build>
<plugins>
<!-- initialize git revision info -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.4</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<prefix>build</prefix>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<skipPoms>false</skipPoms>
<verbose>false</verbose>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>create-missingpost-treatment</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source><![CDATA[
def confDir = new File(project.build.directory, "conf")
def treatmentFile = new File(confDir, project.artifactId+"/PostTreatment.groovy")
if(confDir.exists() && !treatmentFile.exists()){
treatmentFile.parentFile.mkdirs()
treatmentFile << """
class PostTreatment {
def run(def project, def log, def ant, def basedirFile, def configDir,
def target, def subTarget, def targetDir) {
log.info("No post treatment required for this project")
}
}
"""
}
]]></source>
</configuration>
</execution>
<execution>
<id>post-treatment-script</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scriptpath>
<element>${project.build.directory}/conf/${project.artifactId}</element>
<element>${project.build.directory}/conf/scripts</element>
</scriptpath>
<source>${postTreatmentScript}</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
<nonFilteredFileExtension>swf</nonFilteredFileExtension>
<nonFilteredFileExtension>gif</nonFilteredFileExtension>
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
<nonFilteredFileExtension>bmp</nonFilteredFileExtension>
<nonFilteredFileExtension>jpg</nonFilteredFileExtension>
<nonFilteredFileExtension>odg</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>unpack-config</id>
<goals>
<goal>unpack</goal>
</goals>
<phase>initialize</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.georchestra</groupId>
<artifactId>config</artifactId>
<version>${georchestra.version}</version>
<classifier>${server}</classifier>
</artifactItem>
</artifactItems>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteReleases>true</overWriteReleases>
<outputDirectory>${confdir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<classifier>${server}</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>com.c2c</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>1.3</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>localhost</id>
<properties>
<server>localhost</server>
</properties>
</profile>
<!-- template profile -->
<profile>
<id>template</id>
<properties>
<server>template</server>
</properties>
</profile>
<profile>
<id>all</id>
<activation>
<file>
<!-- this is added so that all will be the default profile -->
<!-- one can build only a specific project by doing -->
<!-- -P-all,extractorapp -->
<missing>hack_to_make_all_enabled_by_default</missing>
</file>
</activation>
<modules>
<module>cas-server-webapp</module>
<module>catalogapp</module>
<module>extractorapp</module>
<module>geoserver</module>
<module>ldapadmin</module>
<module>mapfishapp</module>
<module>security-proxy</module>
<module>geonetwork</module>
<module>downloadform</module>
<module>analytics</module>
<module>header</module>
</modules>
</profile>
<profile>
<id>cas-server-webapp</id>
<modules>
<module>cas-server-webapp</module>
</modules>
</profile>
<profile>
<id>cas</id>
<modules>
<module>cas-server-webapp</module>
</modules>
</profile>
<profile>
<id>catalogapp</id>
<modules>
<module>catalogapp</module>
</modules>
</profile>
<profile>
<id>header</id>
<modules>
<module>header</module>
</modules>
</profile>
<profile>
<id>extractorapp</id>
<modules>
<module>extractorapp</module>
</modules>
</profile>
<profile>
<id>geoserver</id>
<modules>
<module>geoserver</module>
</modules>
</profile>
<profile>
<id>ldapadmin</id>
<modules>
<module>ldapadmin</module>
</modules>
</profile>
<profile>
<id>mapfishapp</id>
<modules>
<module>mapfishapp</module>
</modules>
</profile>
<profile>
<id>security-proxy</id>
<modules>
<module>security-proxy</module>
</modules>
</profile>
<profile>
<id>proxy</id>
<modules>
<module>security-proxy</module>
</modules>
</profile>
<profile>
<id>geonetwork</id>
<modules>
<module>geonetwork</module>
</modules>
</profile>
<profile>
<id>downloadform</id>
<modules>
<module>downloadform</module>
</modules>
</profile>
<profile>
<id>analytics</id>
<modules>
<module>analytics</module>
</modules>
</profile>
</profiles>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<id>mapfish</id>
<url>http://dev.mapfish.org/maven/repository</url>
</repository>
<!-- geotools -->
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jetty-repository</id>
<name>Jetty Maven2 Repository</name>
<url>http://oss.sonatype.org/content/groups/jetty/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>codehaus-snapshot-plugins</id>
<name>codehaus-shapshot-plugins</name>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<id>mapfish</id>
<url>http://dev.mapfish.org/maven/repository</url>
</pluginRepository>
</pluginRepositories>
</project>
Thanks For the Help

That version of GMaven is truely ancient. I'd try with a newer version or GMavenPlus.

Related

Execution default of goal com.smartbear.soapui:soapui-maven-plugin:4.6.1:test failed

Our SOAPUI test project has recently started failing with the message:
59626 [INFO] ------------------------------------------------------------------------
59626 [INFO] BUILD FAILURE
59626 [INFO] ------------------------------------------------------------------------
59627 [INFO] Total time: 56.863 s
59627 [INFO] Finished at: 2019-08-06T09:57:17+00:00
59703 [INFO] Final Memory: 13M/56M
59704 [INFO] ------------------------------------------------------------------------
59745 [ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:4.6.1:test (default) on project SIFIntegrationTest: Execution default of goal com.smartbear.soapui:soapui-maven-plugin:4.6.1:test failed: Plugin com.smartbear.soapui:soapui-maven-plugin:4.6.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: fife:rsyntaxtextarea:jar:2.0.1, groovy:groovy-all:jar:1.8.0: Could not find artifact fife:rsyntaxtextarea:jar:2.0.1 in smartbear-sweden-plugin-repository (http://smartbearsoftware.com/repository/maven2/) -> [Help 1]
We havent made any changes to it for weeks but now Maven cannot find a couple of JARs.
The 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>com.sif</groupId>
<artifactId>Test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>smartbear-sweden-repository</id>
<url>http://smartbearsoftware.com/repository/maven2/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>smartbear-sweden-plugin-repository</id>
<url>http://smartbearsoftware.com/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>4.6.1</version>
<configuration>
<projectFile>Tests-soapui-project.xml</projectFile>
<outputFolder>${project.build.directory}/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<printReport>false</printReport>
</configuration>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I guess SmartBear has changed their Maven repos, is there a way to fix this?
Our project is on a GitLab CI / CD pipeline using a Maven Image, we have tried directly on GitLab.com to eliminate our network and it still fails there.
Cheers,
Steve

Vaadin custom client side widget cannot compile 'No plugin found for prefix 'vaadin''

I trying to create a custom client side widget with eclipse IDE. when i click compile widgetset option from the toolbar it stops with following error. This topic is a duplicate, but no suitable answer.
[INFO] Scanning for projects...
[INFO] Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
metadata.xml
[INFO] Downloading:
https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
metadata.xml (13 KB at 6.2 KB/sec)
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
(20 KB at 8.4 KB/sec)
[INFO] ---------------------------------------------------------------------
---
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
---
[INFO] Total time: 5.004 s
[INFO] Finished at: 2017-07-04T15:48:53+05:30
[INFO] Final Memory: 15M/143M
[INFO] ---------------------------------------------------------------------
---
[ERROR] No plugin found for prefix 'vaadin' in the current project and in
the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available
from the repositories [local (C:\Users\xxxx\.m2\repository), central
(https://repo.maven.apache.org/maven2)] -> [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]
My Pom.xml
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>logicalintelligence.widget.navigationdrawer</groupId>
<artifactId>navigationdrawer</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Navigationdrawer Add-on</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<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>
<vaadin.version>7.7.10</vaadin.version>
<vaadin.plugin.version>7.7.10</vaadin.plugin.version>
<!-- ZIP Manifest fields -->
<Implementation-Version>${project.version}</Implementation-Version>
<!-- Must not change this because of the Directory -->
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Vaadin-License-Title>Apache License 2.0</Vaadin-License-Title>
<Vaadin-Addon>${project.artifactId}-${project.version}.jar</Vaadin-Addon>
</properties>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<!-- This can be replaced with TestNG or some other test framework supported by the surefire plugin -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<!-- Package format version - do not change -->
<Vaadin-Package-Version>1</Vaadin-Package-Version>
<Vaadin-License-Title>${Vaadin-License-Title}</Vaadin-License-Title>
<Vaadin-Widgetsets>logicalintelligence.widget.navigationdrawer.navigationdrawer.WidgetSet</Vaadin-Widgetsets>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<goals>
<goal>single</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
</plugin>
<!-- Testing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
</plugin>
</plugins>
<!-- This is needed for the sources required by the client-side compiler to be
included in the produced JARs -->
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>rebel.xml</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>
Yes Morfic is right, I solved the problem by adding followings to the pom.xml
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>

How can you use a dependency from the plugin's dependency scope in the maven-antrun-plugin?

We have a profile that uses maven-antrun-plugin to run a downloaded JAR.
Exhibit A: (this works)
We can reference the downloaded JAR using the property ${maven.dependency.com.foobar.target-jar.jar.path} (Can I use the path to a Maven dependency as a property?). But in this solution, the custom dependency and repository information isn't limited to just the scope of the profile.
<project>
...
<repositories>
<repository>
<id>thirdparty</id>
<name>Third Party</name>
<url>
[URL for the repository that holds the target JAR]
</url>
<layout>default</layout>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>com.foobar</groupId>
<artifactId>target-jar</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
...
<profiles>
<profile>
<id>runJARprofile</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<inherited>false</inherited>
<executions>
<execution>
<id>run-jar</id>
<phase>package</phase>
<configuration>
<target name="runJar" fork="true">
<java jar="${maven.dependency.com.foobar.target-jar.jar.path}" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...
</project>
Exhibit B: (haven't gotten it working)
Here, we moved the dependency and repository information into the profile. Maven downloads the artifact successfully, but we no longer know how to reference it by property.
<project>
...
<profiles>
<profile>
<pluginRepositories>
<repository>
<id>thirdparty</id>
<name>Third Party</name>
<url>
[URL for the repository that holds the target JAR]
</url>
<layout>default</layout>
</repository>
</pluginRepositories>
...
<id>runJARprofile</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>com.foobar</groupId>
<artifactId>target-jar</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>run-jar</id>
<phase>package</phase>
<configuration>
<target name="runJar" fork="true">
<java jar="${?????}" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...
</project>
I crated a POM similar to your Exhibit B here and got the following message during a mvn package -P runJARprofile:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run
(run-jar) on project so-36848518: An Ant BuildException has occured:
Cannot execute a jar in non-forked mode. Please set fork='true'.
[ERROR] around Ant part ...<java jar="${my:test:jar}"/>...
I changed the respective line to:
<java jar="${my:test:jar} fork="true"/>
and:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Where to specify the repository element for Artifactory release?

I am trying to release a project in the Artifactory repository. It’s a project which is a dependency of my main project, so I would like to put the pom, the .jar and the sources.jar in the artifactory repository.
The settings.xml file is stored in the maven directory :
D:\...\...\maven\apache-maven-3.3.1\conf
I have already tagged the version using following maven command :
mvn clean release:prepare
Then, if I try :
mvn clean release:perform –Partifactory
, I get the error :
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ........ : Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
What should I do to use the artifactory profile ? Is it possible without changing the pom ?
I have tried without success to copy the settings.xml in my local maven repository.
If I have to change the pom, can I first come back before the state obtained after the mvn release:prepare command ? In the following link, I didn’t understand if I have to do something manually or not (remove tag from the SCM) :
http://maven.apache.org/maven-release/maven-release-plugin/examples/rollback-release.html
The settings.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\...\...\maven\repository</localRepository>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://x/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://x/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://x/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://x/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
The pom :
<?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/maven-v4_0_0.xsd">
<parent>
<groupId>....</groupId>
<artifactId>my-parent</artifactId>
<version>1.0.6</version>
<relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>....</groupId>
<artifactId>myproject</artifactId>
<packaging>jar</packaging>
<version>1.9.6-SNAPSHOT</version>
<name>myproject</name>
<url>${wiki.url}</url>
<scm> <developerConnection>scm:svn:http://x/svn/main/y/Development/Components/trunk/myproject</developerConnection>
<url>http://x/svn/main/y/Development/Components/trunk/myproject</url>
</scm>
<ciManagement>
<system>${ciManagement.system}</system>
<url>${ciManagement.url}/${project.artifactId}</url>
</ciManagement>
<properties>
</properties>
<dependencies>
<! - - my dependencies - - >
</dependencies>
<build>
<plugins>
<plugin>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<configuration> <tagBase>http://x/svn/main/y/Development/Components/tags</tagBase>
</configuration>
</plugin>
</plugins>
</build>
</project>
The parent pom :
<!-- language: lang-xml -->
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>....</groupId>
<artifactId>my-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.6</version>
<name>my-parent</name>
<url>${wiki.url}</url>
<scm>
<developerConnection>scm:svn:http://x/svn/main/y/Development/Components/tags/my-parent-1.0.6</developerConnection>
<url>http://x/svn/main/y/Development/Components/tags/my-parent-1.0.6</url>
</scm>
<ciManagement>
<system>${ciManagement.system}</system>
<url>${ciManagement.url}/${project.artifactId}</url>
</ciManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</build>
</project>
Two things. You should declare a <distributionManagement> section in your POM:
<project>
...
<distributionManagement>
<repository>
<id>my-artifactory</id>
<name>Artifactory Release Repo</name>
<url>http://x/artifactory/libs-release</url>
</repository>
<snapshotRepository>
<id>my-artifactory</id>
<name>Artifactory Release Repo</name>
<url>http://x/artifactory/libs-snapshot</url>
</snapshotRepository>
</distributionManagement>
</project>
The <id> tags must match an entry in your settings.xml for the credentials to match:
<settings>
...
<servers>
<server>
<id>my-artifactory</id>
<username>bob</username>
<password>secret</password>
</server>
</servers>
</settings>
Now, that being said, since mvn release:prepare has already tagged the release in your VCS, you don't need to cut a new release, but I would advise you to add the <distributionManagement> section to the POM. One way to deploy the artifacts is to simply get the tag from the VCS and do an mvn deploy, like so:
svn co <the url to your tag>
mvn -DaltDeploymentRepository=my-artifactory::default::http://x/artifactory/libs-release deploy

ant task retrieve maven profile dependency

i have a java project with a automatically generated ant files. so i'm forced to use ant to build the project. I needed to add some new libraries and i used the below maven pom file. i then use an ant task to retrieve the pom dependencies and copy them into a lib folder. however the following ant task misses the profile dependencies in the pom.
what i want to do is an ant task so that based on current os it will include the corresponding xurlrunner jar for the os. this is done by maven in the pom but how can i do it with ant ?
---ant target task----
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath"/>
<target name="retrieve-dependencies">
<artifact:dependencies filesetId="dependency.fileset"
sourcesFilesetId="profiles.dependency.fileset"
versionsId="dependency.versions">
<pom file="${basedir}/nbproject/pom.xml"/>
</artifact:dependencies>
<delete dir="${lib.dir}/browser"/>
<copy todir="${lib.dir}/browser">
<fileset refid="dependency.fileset"/>
<mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
from="${dependency.versions}" to="flatten"/>
</copy>
</target>
---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>org.drOffice.browser</groupId>
<artifactId>embedded-browser</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.6</compilerVersion>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugins>
</build>
<repositories>
<repository>
<id>atomation-repository</id>
<name>atomation maven repository</name>
<url>http://atomation-repository.googlecode.com/svn/trunk</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ru.atomation.jbrowser</groupId>
<artifactId>jbrowser</artifactId>
<version>1.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>generic</id>
<activation>
<activeByDefault></activeByDefault>
</activation>
</profile>
<profile>
<id>linux</id>
<dependencies>
<dependency>
<groupId>ru.atomation.native</groupId>
<artifactId>xulrunner-linux</artifactId>
<version>1.9</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>solaris</id>
<dependencies>
<dependency>
<groupId>ru.atomation.native</groupId>
<artifactId>xulrunner-solaris</artifactId>
<version>1.9</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>macosx</id>
<dependencies>
<dependency>
<groupId>ru.atomation.native</groupId>
<artifactId>xulrunner-macosx</artifactId>
<version>1.9</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>windows</id>
<dependencies>
<dependency>
<groupId>ru.atomation.native</groupId>
<artifactId>xulrunner-windows</artifactId>
<version>1.9</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
If you only use Ant to copy the dependencies, I assume it would be by far simpler to use maven to copy these dependencies.
If you really want to use Ant, you can simply define the property in your pom (in the profile), and use it in the Ant script.
Something like
<profile>
<id>linux</id>
<properties>
<custom.property>linux</custom.property>
<properties>
.....

Resources