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

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>

Related

Issue in Compiling SOA 12C project with Maven

I am trying to build my SOA 12.2.1.0.0 project with Maven3.2.5 and using the default Maven local repository.I have done the below steps:
1.Installed the Maven synchronisation plugin to the local respository(mvn install)
2.Pushed all the required libraries to the local repository using Push goal
3.Updated the archetype to reflect the newly installed libraries.
When I am trying to compile the project using Maven, I am getting the below errors like:
1.0-SNAPSHOT: Failed to collect dependencies at com.oracle.adf.library:BC4J-Service-Runtime:pom:12.2.1-0-0' 'No
versions available for
com.oracle.legacy_oc4j_xml_schemas:com.oracle.webservices.fmw.web-common-schemas-impl:jar:[12.2.1,12.2.2)
within specified range
The com.oracle.legacy_oc4j_xml_schemas of the repository contains a folder(com.oracle.webservices.fmw.web-common-schemas-impl) with a single file resolver-status.properties having the content:
maven-metadata-central.xml.error=
maven-metadata-central.xml.lastUpdated=1468297090681
Below is the effective pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.oracle.soa</groupId>
<artifactId>sar-common</artifactId>
<version>12.2.1-0-0</version>
<relativePath></relativePath>
</parent>
<groupId>MavenIntegrationApplication</groupId>
<artifactId>TestProjectMaven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>sar</packaging>
<description>Oracle FMW Common Parent POM</description>
<url>http://www.oracle.com/us/products/middleware/overview/index.html/sar-common/TestProjectMaven</url>
<inceptionYear>2012</inceptionYear>
<properties>
<password></password>
<scac.input>D:\JDEVWorkspace-12C\TestProjectMaven/SOA//composite.xml</scac.input>
<oraclePassword></oraclePassword>
<overwrite>true</overwrite>
<composite.partition>default</composite.partition>
<regenerateRulebase>false</regenerateRulebase>
<scac.error>D:\JDEVWorkspace-12C\TestProjectMaven/target/error.txt</scac.error>
<oracleServerUrl>http://localhost:7003</oracleServerUrl>
<scac.output.dir>D:\JDEVWorkspace-12C\TestProjectMaven/target</scac.output.dir>
<composite.revision>1.0</composite.revision>
<oracleHome>${env.ORACLE_HOME}</oracleHome>
<forceDefault>true</forceDefault>
<scac.displayLevel>1</scac.displayLevel>
<composite.name>TestProjectMaven</composite.name>
<input>TestProjectMaven</input>
<keepInstancesOnRedeploy>false</keepInstancesOnRedeploy>
<scac.output>D:\JDEVWorkspace-12C\TestProjectMaven/target/out.xml</scac.output>
<scac.input.dir>D:\JDEVWorkspace-12C\TestProjectMaven/SOA/</scac.input.dir>
<oracleServerName>soa_server1</oracleServerName>
<oracleUsername></oracleUsername>
<serverUrl>http://localhost:7003</serverUrl>
<scatest.result>D:\JDEVWorkspace-12C\TestProjectMaven/target/testResult</scatest.result>
<oracleMiddlewareHome>/home/myhome/Oracle/Middleware</oracleMiddlewareHome>
<user></user>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle.adf.library</groupId>
<artifactId>SOA-Designtime</artifactId>
<version>12.2.1-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.adf.library</groupId>
<artifactId>SOA-Runtime</artifactId>
<version>12.2.1-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.adf.library</groupId>
<artifactId>BPEL-Runtime</artifactId>
<version>12.2.1-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.adf.library</groupId>
<artifactId>Mediator-Runtime</artifactId>
<version>12.2.1-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.adf.library</groupId>
<artifactId>MDS-Runtime</artifactId>
<version>12.2.1-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\java</sourceDirectory>
<scriptSourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\scripts</scriptSourceDirectory>
<testSourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\test\java</testSourceDirectory>
<outputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\classes</outputDirectory>
<testOutputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\test-classes</testOutputDirectory>
<resources>
<resource>
<directory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>D:\JDEVWorkspace-12C\TestProjectMaven\src\test\resources</directory>
</testResource>
</testResources>
<directory>D:\JDEVWorkspace-12C\TestProjectMaven\target</directory>
<finalName>TestProjectMaven-1.0-SNAPSHOT</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.oracle.soa.plugin</groupId>
<artifactId>oracle-soa-plugin</artifactId>
<version>12.2.1-0-0</version>
<extensions>true</extensions>
<configuration>
<compositeName>TestProjectMaven</compositeName>
<composite>D:\JDEVWorkspace-12C\TestProjectMaven/SOA//composite.xml</composite>
<sarLocation>D:\JDEVWorkspace-12C\TestProjectMaven/target/sca_TestProjectMaven_rev1.0-SNAPSHOT.jar</sarLocation>
<serverUrl>http://localhost:7003</serverUrl>
<user></user>
<password></password>
<compositeRevision>1.0</compositeRevision>
<revision>1.0</revision>
<scacInputDir>D:\JDEVWorkspace-12C\TestProjectMaven/SOA/</scacInputDir>
<input>TestProjectMaven</input>
</configuration>
</plugin>
<plugin>
<groupId>com.oracle.maven</groupId>
<artifactId>oracle-maven-sync</artifactId>
<version>12.2.1-0-0</version>
<configuration>
<serverId>internal</serverId>
<oracleHome>D:\OracleSOA12C\Oracle_Home</oracleHome>
<testOnly>false</testOnly>
</configuration>
</plugin>
<plugin>
<groupId>com.oracle.adf.plugin</groupId>
<artifactId>ojdeploy</artifactId>
<version>12.2.1-0-0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<ojdeploy>${env.ORACLE_HOME}/jdeveloper/jdev/bin/ojdeploy.exe</ojdeploy>
<workspace>D:\JDEVWorkspace-12C\TestProjectMaven/../MavenIntegrationApplication.jws</workspace>
<project>TestProjectMaven</project>
<profile>TestProjectMaven</profile>
<outputfile>D:\JDEVWorkspace-12C\TestProjectMaven\target/TestProjectMaven-1.0-SNAPSHOT.jar</outputfile>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\site</outputDirectory>
</reporting>
</project>
Can someone help me solve this issue, if I have missed to do some steps.
I think you should remove <type>pom</type> of your dependencies.
If I understand your problem correctly, you have Oracle libs (most likely JARs) provided somewhere so you don't want Maven to include these libs in your packaging. But as you indicate <type>pom</type>, Maven is trying to get the POM of these dependecies and it's not working.
This issue is resolved.It was because not all dependent jars were getting installed using the PUSH command(reason is unknown).After few more trials(deleting and reexceuting the commands), all the jars got installed and now the all the goals are hetting executed successfuly.
Thanks for all the help!

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] ------------------------------------------------------------------------

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

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.

Building an RPM containing JDK dependency resolution

I'm building oracle jdk 1.6 into an rpm using maven and nexus from a zip file distribution of the jdk.
When done, the rpm refuses to install without the following:
[root#build]# rpm -ivh oracle-jdk-1.6.0_26-1.noarch.rpm
error: Failed dependencies:
libXt.so.6()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
libodbc.so()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
libodbcinst.so()(64bit) is needed by oracle-jdk-1.6.0_26-1.noarch
Fine. I'm guessing maven created this dependency. The jdk in it's native unzipped form works fine.
How can I configure my pom so that maven will not resolve these dependencies?
How would I configure my pom so that yum -y install will install the missing libraries?
I ask both, as I'm not sure which way I will sway.
Edit: my pom:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.oracle</groupId>
<artifactId>jdk</artifactId>
<version>1.6.0_26</version>
<packaging>pom</packaging>
<properties>
<unix.user>root</unix.user>
<rpm.friendly.name>oracle-jdk</rpm.friendly.name>
<rpm.install.basedir>/usr/java/jdk/1.6.0_26</rpm.install.basedir>
<sourcefile.unzip.dir>${project.build.directory}/jdk1.6.0_26</sourcefile.unzip.dir>
<yum.repo.host>localhost</yum.repo.host>
<yum.repo.path>/apps/httpd/yumrepo</yum.repo.path>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>jdk</artifactId>
<version>1.6.0_26</version>
<type>tar.gz</type>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>ssh-repository</id>
<url>scpexe://${yum.repo.host}${yum.repo.path}</url>
</repository>
</distributionManagement>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-beta-6</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1-alpha-3</version>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>attached-rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<name>${rpm.friendly.name}</name>
<copyright>2014, JM</copyright>
<group>Application/Internet</group>
<packager>JM</packager>
<needarch>false</needarch>
<changelogFile>src/changelog</changelogFile>
<mappings>
<mapping>
<directory>${rpm.install.basedir}</directory>
<username>${unix.user}</username>
<groupname>${unix.user}</groupname>
<sources>
<source>
<location>${sourcefile.unzip.dir}</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>thirdparty</id>
<url>http://myrepo.com:8081/nexus/content/repositories/thirdparty</url>
</repository>
</repositories>
</project>
Basically i think its not a good idea to include other binaries (like java) in your package
i'd rather have dependency on them.
But sometimes you have to, for example customer already have Java on his machine but you want to run your own java version and thus provide it with your package.
To do that you can simply tell the maven plugin not to automatically add requires to those packages.
like this
<configuration>
......
<autoRequires>false</autoRequires>
</configuration>

Maven: Changing remote directory structure

I have just started to learn maven a few weeks ago. Currently trying to achieve the structure in my mind. Everything up to know is perfect but, i am having an issue about deploying.
The issue is:
when i perform mvn release:perform artifacts are being deployed to my ftp server in ftp://centos-release/maven/linuxapp/releases/com/gmail/baturman/linuxapp/linuxapp/0.0.5/ path.
and when i perform mvn deploy current snapshot is being deployed to ftp server in ftp://centos-gitlab/maven/linuxapp/snapshots/com/gmail/baturman/linuxapp/linuxapp/0.0.6-SNAPSHOT/
everything is cool but, this is not the structure that i want. What i want to have this directory structure:
For release: ftp://centos-release/maven/linuxapp/releases/0.0.5/
For snapshots: ftp://centos-release/maven/linuxapp/snapshots/0.0.6-SNAPSHOT/
Could you please advise?
Here is my pom file.
<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.gmail.baturman.linuxapp</groupId>
<artifactId>linuxapp</artifactId>
<version>0.0.5-SNAPSHOT</version>
<description>Linux App - Powered by git and maven :)</description>
<name>Linux App</name>
<!-- PROPERTIES -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<!-- RELEASE INFORMATION -->
<scm>
<connection>scm:git:gitlab#centos-gitlab:maven/linuxapp.git</connection>
<developerConnection>scm:git:gitlab#centos-gitlab:maven/linuxapp.git</developerConnection>
<url>http://centos-gitlab/maven/linuxapp</url>
<tag>v0.0.3</tag>
</scm>
<distributionManagement>
<repository>
<id>release-server</id>
<name>Release Repository</name>
<url>ftp://centos-gitlab/maven/${project.artifactId}/releases</url>
</repository>
<snapshotRepository>
<id>release-server</id>
<name>Snapshot Repository</name>
<url>ftp://centos-gitlab/maven/${project.artifactId}/snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
<!-- BUILD -->
<build>
<finalName>${project.artifactId}</finalName>
<!-- EXTENSIONS -->
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.4</version>
</extension>
</extensions>
<!-- RESOURCES -->
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/conf</directory>
<excludes>
<exclude>*.properties</exclude>
</excludes>
</resource>
</resources>
<!-- PLUGINS -->
<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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
<useJvmChmod>true</useJvmChmod>
</configuration>
<executions>
<execution>
<id>release-server</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<tagNameFormat>v#{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>
First i would suggest to start using a repository manager like Nexus, Artifactory or Archiva which is a better solution than an ftp server. Apart from that you have to change your definitions:
<distributionManagement>
<repository>
<id>release-server</id>
<name>Release Repository</name>
<url>ftp://centos-gitlab/maven/releases/</url>
</repository>
<snapshotRepository>
<id>release-server</id>
<name>Snapshot Repository</name>
<url>ftp://centos-gitlab/maven/snapshots/</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>

Resources