WSO2 DeveloperStudio CAR Maven deployment exception - maven

Using wso2 developer studio guide and following the istructions at the following page:
https://docs.wso2.com/display/DVS370/Deploying+a+CAR+File+with+the+Maven+Plug-In#DeployingaCARFilewiththeMavenPlug-In-DeployCARfiletotheWSO2ESBserver
i'm not able to deploy a CAR archive in my runnging wso2 esb 4.8.1 instance as i got this exception during maven build:
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) # provaplugin ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.524s
[INFO] Finished at: Mon May 11 18:17:18 CEST 2015
[INFO] Final Memory: 22M/338M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project provaplugin: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
MojoExecutionException - Apache Maven - Apache Software Foundation
cwiki.apache.org
and this exception in the wso2's console:
ERROR - ApplicationManager Error occurred while deploying Carbon Application
org.wso2.carbon.CarbonException: Error while extracting Carbon Application : provaplugin_1.0.0.car
at org.wso2.carbon.application.deployer.AppDeployerUtils.extractCarbonApp(AppDeployerUtils.java:440)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:198)
at org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:114)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:79)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:124)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: /media/ubuntu/CodeHome/TEST%20GREG/wso2esb-4.8.1/repository/deployment/server/carbonapps/provaplugin_1.0.0.car (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:214)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at java.util.zip.ZipFile.<init>(ZipFile.java:115)
at org.wso2.carbon.application.deployer.AppDeployerUtils.extract(AppDeployerUtils.java:653)
at org.wso2.carbon.application.deployer.AppDeployerUtils.extractCarbonApp(AppDeployerUtils.java:438)
... 20 more
[2015-05-11 18:17:22,729] ERROR - CappAxis2Deployer Error while deploying carbon application /media/ubuntu/CodeHome/TEST GREG/wso2esb-4.8.1/repository/deployment/server/carbonapps/provaplugin_1.0.0.car
java.lang.NullPointerException
at org.wso2.carbon.application.deployer.internal.ApplicationManager.revertDeployedArtifacts(ApplicationManager.java:301)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:275)
at org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:114)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:79)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:124)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
But it's weird to me as the archive provaplugin_1.0.0.car is present in /repository/deployment/server/carbonapps/
This is the car pom.xml file
<?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>
<groupId>com.example.provaplugin</groupId>
<artifactId>provaplugin</artifactId>
<version>1.0.0</version>
<packaging>carbon/application</packaging>
<name>provaplugin</name>
<description>provaplugin</description>
<properties>
<com.example.provaDeploy.proxy-service_._adminEndpoint>capp/EnterpriseServiceBus</com.example.provaDeploy.proxy-service_._adminEndpoint>
<artifact.types>jaggery/app=zip,service/rule=aar,lib/library/bundle=jar,synapse/message-processors=xml,synapse/endpointTemplate=xml,synapse/proxy-service=xml,synapse/message-store=xml,carbon/application=car,registry/resource=zip,lib/dataservice/validator=jar,synapse/endpoint=xml,web/application=war,synapse/sequence=xml,synapse/configuration=xml,lib/registry/handlers=jar,synapse/task=xml,service/meta=xml,webapp/jaxws=war,synapse/api=xml,cep/bucket=xml,bpel/workflow=zip,lib/registry/filter=jar,service/dataservice=dbs,synapse/local-entry=xml,synapse/priority-executor=xml,synapse/event-source=xml,synapse/template=xml,lib/carbon/ui=jar,service/axis2=aar,synapse/sequenceTemplate=xml,wso2/gadget=dar,lib/synapse/mediator=jar</artifact.types>
</properties>
<dependencies>
<dependency>
<groupId>com.example.provaDeploy.proxy-service</groupId>
<artifactId>adminEndpoint</artifactId>
<version>1.0.0</version>
<type>xml</type>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
<repository>
<id>wso2-maven2-repository-1</id>
<url>http://dist.wso2.org/maven2</url>
</repository>
<repository>
<id>wso2-nexus-repository-1</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
<pluginRepository>
<id>wso2-maven2-repository-1</id>
<url>http://dist.wso2.org/maven2</url>
</pluginRepository>
<pluginRepository>
<id>wso2-nexus-repository-1</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<buildcommands />
<projectnatures>
<projectnature>org.wso2.developerstudio.eclipse.distribution.project.nature</projectnature>
</projectnatures>
</configuration>
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-plugin</artifactId>
<version>2.0.9</version>
<extensions>true</extensions>
<executions>
<execution>
<id>car</id>
<phase>package</phase>
<goals>
<goal>car</goal>
</goals>
</execution>
</executions>
<configuration />
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-deploy-plugin</artifactId>
<version>1.0.9</version>
<extensions>true</extensions>
<configuration>
<carbonServers>
<CarbonServer>
<trustStorePath>/media/ubuntu/CodeHome/TEST GREG/wso2esb-4.8.1/repository/resources/security/wso2carbon.jks</trustStorePath>
<trustStorePassword>wso2carbon</trustStorePassword>
<trustStoreType>JKS</trustStoreType>
<serverUrl>https://localhost:9445</serverUrl>
<userName>admin</userName>
<password>admin</password>
<operation>deploy</operation>
</CarbonServer>
</carbonServers>
</configuration>
</plugin>
</plugins>
</build>
</project>
http://maven.apache.org/POM/4.0.0
maven.apache.org
I get the same exception when i try deploy the car directly from eclipse ide on the developer studio WSO2Carbon server.
What's wrong?

This issue occurs when there is a space in the capp path, which is related to this issue. And, this has been fixed in the later version.

You should specify the repositories in the Distribution Management.
Maven Distribution Management
Inside project add following distributionManagement repository.
<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">
.........
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Internal repo</name>
<url>file:///home/thara/testesb/in</url>
</repository>
</distributionManagement>
............
</project>
For the above example I gave my file system (Linux).

Related

Could not transfer metadata net.minidev:json-smart/maven-metadata.xml from/to clojars

I'm trying to build an Apache Storm topology, and getting the following error while running mvn assembly:assembly.
$ mvn assembly:assembly
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WordCount 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-assembly-plugin:2.2-beta-5:assembly (default-cli) # WordCount >>>
Downloading: https://repo1.maven.org/maven2/com/twitter/carbonite/1.5.0/carbonite-1.5.0.pom
Downloading: https://clojars.org/repo/com/twitter/carbonite/1.5.0/carbonite-1.5.0.pom
Downloading: https://repo1.maven.org/maven2/net/minidev/json-smart/maven-metadata.xml
Downloading: https://repository.apache.org/content/repositories/snapshots/net/minidev/json-smart/maven-metadata.xml
Downloading: https://clojars.org/repo/net/minidev/json-smart/maven-metadata.xml
Downloading: https://repository.apache.org/snapshots/net/minidev/json-smart/maven-metadata.xml
Downloading: http://repository.jboss.org/nexus/content/groups/public/net/minidev/json-smart/maven-metadata.xml
Downloaded: https://repo1.maven.org/maven2/net/minidev/json-smart/maven-metadata.xml (2 KB at 1.9 KB/sec)
[WARNING] Could not transfer metadata net.minidev:json-smart/maven-metadata.xml from/to clojars (https://clojars.org/repo/): hostname in certificate didn't match: <repo.clojars.org> != <v.ssl-384-default.ssl.fastly.net> OR <v.ssl-384-default.ssl.fastly.net>
Downloading: https://repo1.maven.org/maven2/net/minidev/json-smart/1.3.3/json-smart-1.3.3.pom
Downloaded: https://repo1.maven.org/maven2/net/minidev/json-smart/1.3.3/json-smart-1.3.3.pom (2 KB at 6.7 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.094s
[INFO] Finished at: Wed Jan 19 13:13:40 KST 2022
[INFO] Final Memory: 26M/1924M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project WordCount: Could not resolve dependencies for project com.c3.example:WordCount:jar:1.0-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:4.11 (test), org.apache.storm:storm-core:jar:2.2.0 (provided)]: Failed to read artifact descriptor for com.twitter:carbonite:jar:1.5.0: Could not transfer artifact com.twitter:carbonite:pom:1.5.0 from/to clojars (https://clojars.org/repo/): hostname in certificate didn't match: <repo.clojars.org> != <v.ssl-384-default.ssl.fastly.net> OR <v.ssl-384-default.ssl.fastly.net> -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
My pom.xml is:
$ cat 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.c3.example</groupId>
<artifactId>WordCount</artifactId>
<version>1.0-SNAPSHOT</version>
<name>WordCount</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>clojars</id>
<url>https://clojars.org/repo/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<storm.version>2.2.0</storm.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>${storm.version}</version>
<!-- keep storm out of the jar-with-dependencies -->
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<includeProjectDependencies>true</includeProjectDependencies>
<includePluginDependencies>false</includePluginDependencies>
<classpathScope>compile</classpathScope>
<mainClass>${storm.topology}</mainClass>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.c3.example.WordCountTopology</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}/resources</directory>
<filtering>false</filtering>
<includes>
<include>log4j2.xml</include>
</includes>
</resource>
</resources>
</build>
</project>
When I tried before, this project seemed to be built without any error.
I don't get why it fails to collect junit and storm-core dependencies.
I'm not used to maven project, so any links or comments would be appreciated.

Starting Tomcat 8 with Cargo in background

I'm trying to run a web application using Cargo and Tomcat 8 (installed mode). I would start Tomcat as a background process with maven (by default, cargo:run blocks the console, waiting for a Ctrl+C), so I set cargo.process.spawn property to true, but I get the following output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building webapp-launcher 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.6.2:run (default-cli) # webapp-launcher ---
[INFO] [en2.ContainerRunMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.6.2 for container tomcat8x
[INFO] [talledLocalContainer] Tomcat 8.x starting...
[INFO] [stalledLocalDeployer] Deploying [/home/tomcat/.m2/repository/<<****removed****>>/<<****removed****>>.war] to [/home/tomcat/<<****removed****>>/target/cargo/configurations/tomcat8x/webapps]...
[INFO] [talledLocalContainer] Tomcat 8.x started on port [8080]
[INFO] [talledLocalContainer] spawn does not allow attributes related to input, output, error, result
[INFO] [talledLocalContainer] spawn also does not allow timeout
[INFO] [talledLocalContainer] finally, spawn is not compatible with a nested I/O <redirector>
[INFO] Press Ctrl-C to stop the container...
I tried to set timeout to 0, but nothing changed.
This is the pom.xml I'm using to deploy the webapp:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dummy.test</groupId>
<artifactId>webapp-launcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<repositories>
<repository>
<id>nexus-snapshots-1</id>
<name>Snaphots</name>
<url>***********************removed***********************</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-releases-1</id>
<name>Releases</name>
<url>***********************removed***********************</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<version>***********************removed***********************</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.2</version>
<configuration>
<container>
<timeout>0</timeout>
<containerId>tomcat8x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.12</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
<properties>
<cargo.process.spawn>true</cargo.process.spawn>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</build>
</project>
EDIT:
I think it's a bug, since the org.codehaus.cargo.container.spi.jvm.DefaultJvmLauncherFactory class sets a lot of hardcoded parameters that are not compatible with spawn mode (see this line).
It should be fixed in Cargo version 1.6.3.

Why is Maven trying to resolve a dependency from my company's repository when it isn't referenced in this project?

I am playing with Vaadin and want to use an add-on widgetset. I got a repository spec and a dependency to put in my maven file, which I did:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myCompany</groupId>
<artifactId>Vaadin2</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Vaadin2</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<vaadin.version>7.7.1</vaadin.version>
<vaadin.plugin.version>7.7.1</vaadin.plugin.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customisations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>flexibleoptiongroup</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<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>
<configuration>
<runTarget>http://localhost:8080/Vaadin2</runTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</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>
Then I attempt to update the widget set, which goes like this:
C:\Users\rcook\Documents\NetBeansProjects\mavenproject1\Vaadin2>mvn vaadin:update-widgetset install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Vaadin2 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://gaia.myCompany.com:9080/archiva/repository/internal/org/vaadin/addons/flexibleoptiongroup/2.3.0/flexibleoptiongroup-2.3.0.pom
[WARNING] The POM for org.vaadin.addons:flexibleoptiongroup:jar:2.3.0 is missing, no dependency information available
Downloading: http://gaia.myCompany.com:9080/archiva/repository/internal/org/vaadin/addons/flexibleoptiongroup/2.3.0/flexibleoptiongroup-2.3.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.036s
[INFO] Finished at: Tue Sep 27 16:38:37 EDT 2016
[INFO] Final Memory: 10M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Vaadin2: Could not resolve dependencies for project com.myCompany:Vaadin2:war:1.0-SNAPSHOT: Could not find artifact org.vaadin.addons:flexibleoptiongroup:jar:2.3.0 in archiva.default (http://gaia.myCompany.com:9080/archiva/repository/internal/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
C:\Users\rcook\Documents\NetBeansProjects\mavenproject1\Vaadin2>
gaia is the name of a server within my company that holds the Maven repository for other projects, but I don't understand why Maven insists on looking there, or even how it knows about it in this instance. The string 'gaia' doesn't appear in the settings.xml at all. Where could it obtain the URL for the gaia repository, so I can turn it off for this project? And why doesn't maven use the repository I configured in the pom.xml for this project?
Windows 7, if that matters...
My first idea would be the settings file. Did you check the mvn dependency:effective-pom to get more info on the project or mvn help:effective-settings for more details on the settings?

Error of maven webxml attribute is required but i have my web xml?

I try use open shift. And try deploy dynamic web project from eclipse with openshift plugin help in openshift tomcat 7. And when i try deploy i have building error, i bad in maven but like i understand it is becouse maven do not see my web.xml but i have my web.xml. Project do not have some exotic api. It is my WebContent/WEB-INF/web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Test</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
when i try build it i have:
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 3.525s
[INFO] Finished at: Fri Apr 08 14:01:52 EDT 2016
[INFO] Final Memory: 8M/111M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project mywebtestproject: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5707e54c2d52712b110000cf/jbossews
and it is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mywebtestproject</groupId>
<artifactId>mywebtestproject</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>mywebtestproject</name>
<repositories>
<repository>
<id>eap</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>eap</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1003-jdbc4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be used when
invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization your app
will need. -->
<!-- By default that is to put the resulting archive into the 'webapps'
folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>openshift</id>
<build>
<finalName>mywebtestproject</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Did you try put this on your pom.xml ? include the <webXml> tag.
<build>
<finalName>mywebtestproject</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>

Trying to access Oracle's Maven repository

I'm attempting to access Oracle's repository. Oracle doesn't make it easy. However, I'm attempting to follow the documentation that Oracle provided.
I've:
Approved the licensing agreement on my system (in case there's some sort of cookie that needs to be set).
Set both M2_HOME and MAVEN_HOME to /usr/share/apache-maven.
Created an Oracle account.
Added the Oracle Repository to my settings.xml file.
Downloaded wagon-http 2.8 and put it in my $M2_HOME/libs/ext directory.
Generated a master password and put it in $HOME/.m2/settings-security.xml
Generated an encrypted password.
Added the Oracle Maven Repository to my $HOME/.m2/settings.xml file as specified.
Configured HTTP Wagon and added that to my $HOME/.m2/settings.xml file.
My project POM looks like this:
<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>com.vegicorp</groupId>
<artifactId>testMe</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>testMe</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>wls-api</artifactId>
<version>12.1.2</version>
</dependency>
</dependencies>
</project>
My settings.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>central</id>
</server>
<server>
<username>qazwart</username>
<password>swordfish</password>
<id>snapshots</id>
</server>
<server>
<id>maven.oracle.com</id>
<username>qazwart#foo.com</username>
<password>{swordfish=}</password>
<configuration>
<basicAuthScope>
<host>ANY</host>
<port>ANY</port>
<realm>OAM 11g</realm>
</basicAuthScope>
<httpConfiguration>
<all>
<params>
<property>
<name>http.protocol.allow-circular-redirects</name>
<value>%b,true</value>
</property>
</params>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<id>maven.oracle.com</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.oracle.com</url>
<layout>default</layout>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://repo.vegicorp.net/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven.oracle.com</id>
<url>https://maven.oracle.com</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://repo.vegicorp.net/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
When I run Maven, I get this:
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testMe 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://maven.oracle.com/commons-io/commons-io/2.4/commons-io-2.4.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom
Downloaded: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom (10 KB at 69.4 KB/sec)
Downloading: https://maven.oracle.com/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-release/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
Downloading: http://repo.vegicorp.net/artifactory/libs-snapshot/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.787 s
[INFO] Finished at: 2015-06-15T16:37:56-04:00
[INFO] Final Memory: 9M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project testMe: Could not resolve dependencies for project com.vegicorp:testMe:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.oracle:wls-api:jar:12.1.2: Failed to read artifact descriptor for com.oracle:wls-api:jar:12.1.2: Could not transfer artifact com.oracle:wls-api:pom:12.1.2 from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
It appears that I don't have access to the Oracle repository although I accepted the licensing agreement and am using the account I've created. Is there something I'm missing? If I remove the reference to wls-api.jar in my pom.xml, it works.
From your settings.xml I can see that you use Artifactory. Why won't you define Oracle's repository as a remote in Artifactory? That will make the access much easier. Here's a simple guide on how to do so.
And, of course, here's the official user guide on it.
I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.
For anybody that has spent any time fighting with this ... make sure that the ID of the oracle repository in your POM is the same as the ID of the server defined in your Settings.xml.
This is not documented anywhere but it appears that maven just does not request authorization if these IDs do not match. It does not attempt it based upon the URL as other solutions appear to suggest.
I think you missed accepting the Oracle Maven repository terms and conditions. https://www.oracle.com/webapps/maven/register/license.html

Resources