Starting Tomcat 8 with Cargo in background - maven

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.

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.

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?

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

When deploying to maven the upload hangs forever

I'm deploying a library to my remote maven repository.
when I run mvn -U deploy or simply mvn deploy everything looks fine apart when uploading the artifact. It just hangs in there forever.
Just like this:
Uploading: http://maven.mycompany.com/server-product/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
213/213 KB
I've read here, here, here and here but they are all related to downloading, not uploading. I can download just fine, but uploading my artifact it just hangs. Those links are related to some bug on previous maven versions, I'm using Apache Maven 3.3.3
The remote server is running Artifactory 3.6.0 (rev. 30178)
Anyone know where is the problem? What am I doing wrong?
Here is my settings.xml file:
<?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>admin</username>
<password>superSecretPassword</password>
<id>central</id>
</server>
<server>
<id>myCompany Maven</id>
<username>admin</username>
<password>superSecretPassword</password>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://maven.myCompany.com/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://maven.myCompany.com/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://maven.myCompany.com/plugins-release</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
Here's 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myCompany.product.server.common</groupId>
<artifactId>Common</artifactId>
<version>3.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
(dependencies...)
</dependencies>
<distributionManagement>
<repository>
<id>myCompany Maven</id>
<name>myCompany Maven-releases</name>
<url>http://maven.myCompany.com/server-product</url>
</repository>
</distributionManagement>
</project>
And here is the ouput from mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Common 3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # Common ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/dwnz/Development/Server/code/product/Common/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # Common ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Common ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # Common ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # Common ---
[INFO] Installing /Users/dwnz/Development/Server/code/product/Common/target/Common-3.0.jar to /Users/dwnz/.m2/repository/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
[INFO] Installing /Users/dwnz/Development/Server/code/product/Common/pom.xml to /Users/dwnz/.m2/repository/com/mycompany/product/server/common/Common/3.0/Common-3.0.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # Common ---
Uploading: http://maven.mycompany.com/server-product/com/mycompany/product/server/common/Common/3.0/Common-3.0.jar
213/213 KB ---->> Here it hangs *forever*!
I had a similar problem. mvn deploy would almost finish uploading and then it would just hang. The issue turned out to be my credentials.
I had a similar problem, exactly when executing release:perform. It got stuck while uploading. My solution was it to add a plugin, change some versions and one groupId in the build section from:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>com.google.code.maven-svn-wagon</groupId>
<artifactId>maven-svn-wagon</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</plugin>
to
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<dependencies>
<dependency>
<groupId>org.jvnet.wagon-svn</groupId>
<artifactId>wagon-svn</artifactId>
<version>1.12</version>
</dependency>
</dependencies>
</plugin>
I had a similar problem, and the solution was to add "artifactory" to the server path. After tracing the actual HTTP traffic I could see that for the downloads the server was correctly redirectnng Maven from
http://maven.myCompany.com/libs-release to http://maven.myCompany.com/artifactory/libs-release
but for the upload this redirect wasn't working
So the answer for me was to change my pom to include correct path and avoid redirects:
<distributionManagement>
<repository>
<id>myCompany Maven</id>
<name>myCompany Maven-releases</name>
<url>http://maven.myCompany.com/artifactory/lib-snapshot-local</url>
</repository>
</distributionManagement>
In my case, I noticed that the deploy process was hanging when the system was downloading a small pre-existing file from the remote repository, and appeared to have an incorrect byte count (e.g. reported having downloaded "1009/1008 bytes"). This appears to happen occasionally when people deploy from different OS environments. My doubtless less-than-optimal way of resolving this problem was to log in to the remote repository and delete the offending file; this appeared to resolve the problem when I next tried to deploy the same project.
For me, adding this to the POM in build / plugins was the crucial step:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<dependencies>
<dependency>
<!-- on its own, this very old plugin seems to include very old versions
of wagon-ssh, jsch and svnkit -->
<groupId>com.google.code.maven-svn-wagon</groupId>
<artifactId>maven-svn-wagon</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.53</version>
</dependency>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.12</version>
</dependency>
</dependencies>
</plugin>
This happened to me when the backing database was mysql and the partition that it was storing its binary logs to ran out of space. Mysql hang, causing arifactory to hang during an upload. Freeing up some space on that partition immediately resolved the issue.
In my case the solution was ridiculously simple, nevertheless, taked me four or five days to discover it, waiting 4 min / deploy ..... The problem was .......
.... AntiVirus !!! ... Turned it off and, voila, 20 seconds/deploy.
Thanks

WSO2 DeveloperStudio CAR Maven deployment exception

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).

Resources