Build Failure GeoNetwork opensource - maven

I try build GeoNetwork opensource, but I have the following problem when I run "mvn clean install -DskipTests":
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 1.8.0_191, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: it_IT, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-20-generic", arch: "amd64", family:
"unix"
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective
model for org.geonetwork-opensource:wfsfeature-harvester:jar:3.4.5-
SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-jar-plugin is missing. #
org.geonetwork-opensource:wfsfeature-harvester:[unknown-version],
/home/barbara/core-geonetwork/workers/wfsfeature-harvester/pom.xml,
line 75, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer
support building such malformed projects.
[WARNING]
[INFO] ---------------------------------------------------------------
---------
[INFO] Reactor Build Order:
[INFO]
[INFO] GeoNetwork opensource
[INFO] common utils
[INFO] Caching xslt module
[INFO] ArcSDE module (dummy-api)
[INFO] GeoNetwork domain
[INFO] Oaipmh modules
[INFO] GeoNetwork Events
[INFO] GeoNetwork schema plugins
[INFO] GeoNetwork schema plugins core
[INFO] GeoNetwork schema plugin for ISO19139/119 standards
[INFO] GeoNetwork index using Elasticsearch
[INFO] GeoNetwork index Elasticsearch client
[INFO] GeoNetwork core
[INFO] GeoNetwork schema plugin for Dublin Core records retrieved by CSW
[INFO] GeoNetwork schema plugin for Dublin Core standard
[INFO] GeoNetwork schema plugin for ISO19110 standard
[INFO] GeoNetwork CSW server
[INFO] GeoNetwork harvesters
[INFO] GeoNetwork health monitor
[INFO] GeoNetwork services
[INFO] Geonetwork Web Resources 4 Java
[INFO] GeoNetwork INSPIRE Atom
[INFO] GeoNetwork dashboard app based on Kibana
[INFO] messaging
[INFO] workers
[INFO] WFS features harvester
[INFO] Tests for schema plugins
[INFO] GeoNetwork user interface module
[INFO] JS API and Service documentation
[INFO] GeoNetwork Web module
[INFO] GeoNetwork E2E Javascript Tests
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GeoNetwork opensource 3.4.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading from oss.sonatype.org-github-releases:
https://oss.sonatype.org/content/repositories/github-
releases/org/zeroturnaround/jrebel-maven-plugin/1.1.5/jrebel-maven-
plugin-1.1.5.pom
[INFO] Downloading from sonatype-public-repository: https://oss.sonatype.org/content/groups/public/org/zeroturnaround/jrebel-
maven-plugin/1.1.5/jrebel-maven-plugin-1.1.5.pom
[INFO] Downloading from central:
https://repo.maven.apache.org/maven2/org/zeroturnaround/jrebel-maven-
plugin/1.1.5/jrebel-maven-plugin-1.1.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GeoNetwork opensource .............................. FAILURE [ 0.893 s]
[INFO] common utils ....................................... SKIPPED
[INFO] Caching xslt module ................................ SKIPPED
[INFO] ArcSDE module (dummy-api) .......................... SKIPPED
[INFO] GeoNetwork domain .................................. SKIPPED
[INFO] Oaipmh modules ..................................... SKIPPED
[INFO] GeoNetwork Events .................................. SKIPPED
[INFO] GeoNetwork schema plugins .......................... SKIPPED
[INFO] GeoNetwork schema plugins core ..................... SKIPPED
[INFO] GeoNetwork schema plugin for ISO19139/119 standards SKIPPED
[INFO] GeoNetwork index using Elasticsearch ............... SKIPPED
[INFO] GeoNetwork index Elasticsearch client .............. SKIPPED
[INFO] GeoNetwork core .................................... SKIPPED
[INFO] GeoNetwork schema plugin for Dublin Core records retrieved by
CSW SKIPPED
[INFO] GeoNetwork schema plugin for Dublin Core standard .. SKIPPED
[INFO] GeoNetwork schema plugin for ISO19110 standard ..... SKIPPED
[INFO] GeoNetwork CSW server .............................. SKIPPED
[INFO] GeoNetwork harvesters .............................. SKIPPED
[INFO] GeoNetwork health monitor .......................... SKIPPED
[INFO] GeoNetwork services ................................ SKIPPED
[INFO] Geonetwork Web Resources 4 Java .................... SKIPPED
[INFO] GeoNetwork INSPIRE Atom ............................ SKIPPED
[INFO] GeoNetwork dashboard app based on Kibana ........... SKIPPED
[INFO] messaging .......................................... SKIPPED
[INFO] workers ............................................ SKIPPED
[INFO] WFS features harvester ............................. SKIPPED
[INFO] Tests for schema plugins ........................... SKIPPED
[INFO] GeoNetwork user interface module ................... SKIPPED
[INFO] JS API and Service documentation ................... SKIPPED
[INFO] GeoNetwork Web module .............................. SKIPPED
[INFO] GeoNetwork E2E Javascript Tests .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.150 s
[INFO] Finished at: 2018-12-19T12:38:35+01:00
[INFO] Final Memory: 17M/284M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.zeroturnaround:jrebel-maven-plugin:1.1.5 or one of
its dependencies could not be resolved: Failed to read artifact
descriptor for org.zeroturnaround:jrebel-maven-plugin:jar:1.1.5: Could
not transfer artifact org.zeroturnaround:jrebel-maven-plugin:pom:1.1.5
from/to oss.sonatype.org-github-releases
(https://oss.sonatype.org/content/repositories/github-releases):
java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty -> [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/PluginResolutionException
I've installed Java 8
I try both from eclipse and from the command line, but it does not work.
I also tried to do mvn clear install, but nothing.
I followed this link:
https://travis-ci.org/geonetwork/core-geonetwork/builds/467950176
Some idea?
Maven - settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
| and is normally provided in ${user.home}/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -s /path/to/user/settings.xml
|
| 2. Global Level. This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| ${maven.conf}/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -gs /path/to/global/settings.xml
|
| The sections in this sample file are intended to give you a running start at
| getting the most out of your Maven installation. Where appropriate, the default
| values (values used when the setting is not specified) are provided.
|
|-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</interactiveMode>
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
<offline>false</offline>
-->
<!-- pluginGroups
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|-->
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
<server>
<id>deploymentRepo</id>
<username>repouser</username>
<password>repopwd</password>
</server>
-->
<!-- Another sample, using keys to authenticate.
<server>
<id>siteServer</id>
<privateKey>/path/to/private/key</privateKey>
<passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
</servers>
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
| repositories, plugin repositories, and free-form properties to be used as configuration
| variables for plugins in the POM.
|
|-->
<profiles>
<!-- profile
| Specifies a set of introductions to the build process, to be activated using one or more of the
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
| or the command line, profiles have to have an ID that is unique.
|
| An encouraged best practice for profile identification is to use a consistent naming convention
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
| This will make it more intuitive to understand what the set of introduced profiles is attempting
| to accomplish, particularly when you only have a list of profile id's for debug.
|
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
<profile>
<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>jdk14</id>
<name>Repository for JDK 1.4 builds</name>
<url>http://www.myhost.com/maven/jdk14</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
-->
<!--
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
| might hypothetically look like:
|
| ...
| <plugin>
| <groupId>org.myco.myplugins</groupId>
| <artifactId>myplugin</artifactId>
|
| <configuration>
| <tomcatLocation>${tomcatPath}</tomcatLocation>
| </configuration>
| </plugin>
| ...
|
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
| anything, you could just leave off the <value/> inside the activation-property.
|
<profile>
<id>env-dev</id>
<activation>
<property>
<name>target-env</name>
<value>dev</value>
</property>
</activation>
<properties>
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
</properties>
</profile>
-->
</profiles>
<!-- activeProfiles
| List of profiles that are active for all builds.
|
<activeProfiles>
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
</activeProfiles>
-->
</settings>

I found the solution for my problem. My Linux version blocked the downloading maven's jar packages. I solved by the following certificates:
sudo update-ca-certificates -f
sudo apt install ca-certificates-java --reinstall
Then, I followed the geonetwork installation instructions (https://github.com/geonetwork/core-geonetwork/tree/master/software_development) and now it works.

Well, this should work:
download jrebel-plugin from here
go to /home/your_user/.m2/repository and copy the jar to org/zeroturnaround/jrebel-maven-plugin/1.1.5 directory (must exist)
Try to compile again.
EDIT
Go to your local pom.xml and change the line 1185 from:
https://oss.sonatype.org/content/repositories/github-releases
to
https://oss.sonatype.org/content/groups/public

Related

Maven transitive dependency not updating, shows older version

I have modules as below:
root
daemon
common
tests
Now daemon and test both have <dependency>common</dependency>.
I have written them just in brief to understand.
common has jaxrs-api version 2.1.1, earlier it was 2.0.
Built the whole project, cleaned it, but still daemon and tests show older version. common version is consistent across all modules. Dependency Analyzer plugin in IntelliJ still shows common having 2.0 and code has compilation issues due to mismatch.
Each module's version is coming from root as follows:
<parent>
<groupId>com.mycompany.domain</groupId>
<artifactId>app-name</artifactId>
<version>1.0.10-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Apart from screenshot above, below are the only jax-rs entries in mvn dependency:tree
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # common ---
[INFO] com.zzz:common:jar:1.0.10-SNAPSHOT
[INFO] +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.8:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.8:compile
[INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.8:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.1.1:compile
[INFO] +- org.testng:testng:jar:6.9.6:test
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # daemon ---
[INFO] com.zzz:daemon:jar:1.0.10-SNAPSHOT
[INFO] +- com.zzz:common:jar:1.0.10-SNAPSHOT:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.8:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.8:compile
[INFO] | +- javax.ws.rs:javax.ws.rs-api:jar:2.0:compile
[INFO] | \- com.paypal.usf:vo:jar:1.6.5:compile
See the daemon dependency log for issue, its brining older version of common with 2.0. I don't see any conflicts or the jar coming from other dependencies. I have also tried manually deleted the target directories and delete the directories inside .m2 but to no avail.
Run maven dependency:tree and check where the dependency of interest is present.
Maven always take teansitive dependency that is available at less distance from the root node.
Refer - https://dzone.com/articles/solving-dependency-conflicts-in-maven

JanusGraph build failed (TinkerPop 3.2.4)

I cloned JanusGraph repo (d6b3d42) and build it without any problem. I need to use it with ThinkerPop 3.2.4 so I changed its version in pom.xml file. Then I run mvn clean install -DskipTests=true.
[WARNING] The POM for com.github.jeremyh:jBCrypt:jar:jbcrypt-0.4 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JanusGraph: Distributed Graph Database ............. SUCCESS [ 0.563 s]
[INFO] JanusGraph-Core: Core Library for JanusGraph ....... FAILURE [ 0.275 s]
[INFO] JanusGraph-Test: Test Suite for JanusGraph ......... SKIPPED
[INFO] JanusGraph CodePipelines CI: Distributed release testing. SKIPPED
[INFO] JanusGraph-BerkeleyJE: Distributed Graph Database .. SKIPPED
[INFO] JanusGraph-Cassandra: Distributed Graph Database ... SKIPPED
[INFO] JanusGraph-CQL: Distributed Graph Database ......... SKIPPED
[INFO] JanusGraph-ElasticSearch: Distributed Indexing Support SKIPPED
[INFO] JanusGraph-HBase: Parent Module .................... SKIPPED
[INFO] JanusGraph-HBase: Version-independent Core ......... SKIPPED
[INFO] JanusGraph-HBase: 0.98 Compatibility Shim .......... SKIPPED
[INFO] JanusGraph-HBase: 1.x Compatibility Shim ........... SKIPPED
[INFO] JanusGraph-HBase: Universal binary ................. SKIPPED
[INFO] JanusGraph-Hadoop: Parent Module ................... SKIPPED
[INFO] JanusGraph-Hadoop: Version-independent Core ........ SKIPPED
[INFO] JanusGraph-Hadoop: 2.x Compatibility Shim .......... SKIPPED
[INFO] JanusGraph-Hadoop: Universal binary ................ SKIPPED
[INFO] JanusGraph-Lucene: Indexing Support ................ SKIPPED
[INFO] JanusGraph-All: Complete JanusGraph Distribution ... SKIPPED
[INFO] JanusGraph-Solr: Distributed Indexing Support ...... SKIPPED
[INFO] JanusGraph-Dist: Tar and Zip Archives .............. SKIPPED
[INFO] JanusGraph-Dist: Archive with Hadoop 2 ............. SKIPPED
[INFO] JanusGraph-Doc: AsciiDoc Manual for JanusGraph ..... SKIPPED
[INFO] JanusGraph-Examples: Examples for JanusGraph ....... SKIPPED
[INFO] Example-Common: Common Graph Code for Examples ..... SKIPPED
[INFO] Example-BerkeleyJE: BerkeleyJE Storage, Lucene Index SKIPPED
[INFO] Example-Cassandra: C* Thrift Storage, ES Index ..... SKIPPED
[INFO] Example-Cql: C* CQL Storage, ES Index .............. SKIPPED
[INFO] Example-HBase: HBase Storage, Solr Index ........... SKIPPED
[INFO] Example-RemoteGraph: Example with RemoteGraph ...... SKIPPED
[INFO] Example-TinkerGraph: Example with TinkerGraph ...... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.557 s
[INFO] Finished at: 2017-09-27T16:44:59+02:00
[INFO] Final Memory: 24M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project janusgraph-core: Could not resolve dependencies for project org.janusgraph:janusgraph-core:jar:0.2.0-SNAPSHOT: Failure to find com.github.jeremyh:jBCrypt:jar:jbcrypt-0.4 in http://download.oracle.com/maven was cached in the local repository, resolution will not be reattempted until the update interval of oracleReleases has elapsed or updates are forced -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :janusgraph-core
How can I build JanusGraph with TinkerPop 3.2.4 version?
Update the root pom.xml to add the Jitpack repository:
<repository>
<!-- for com.github.jeremyh:jBCrypt:jar -->
<id>jitpack.io</id>
<name>JitPack Package Repository</name>
<url>https://jitpack.io</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
This repository was removed the pom.xml because newer versions of Apache TinkerPop do not have this dependency.
Reference from janusgraph-users Google group:
That dependency isn't found in Maven central, jbcrypt-0.4 is found in the jitpack.io repository. You'll need to add a remote repository for it. You could use the dependency:get command:
mvn dependency:get -DremoteRepositories="https://jitpack.io" -Dartifact="com.github.jeremyh:jBCrypt:jbcrypt-0.4"
When you run the command above, you will download the required jBCrypt dependency into your local Maven repository so that you can continue to build JanusGraph. If you're interested in building a distribution zip, similar to the ones you can find on the JanusGraph downloads page, use this command:
mvn clean install -DskipTests=true -Dgpg.skip=true -Pjanusgraph-release
Then you can find the distribution zip under janusgraph-dist/janusgraph-dist-hadoop-2/target/janusgraph-0.2.0-SNAPSHOT-hadoop2.zip.

Cannot invoke Tomcat manager: Broken pipe

I am running:
ubuntu 14.04
tomcat7
maven3
Here is my error:
ubuntu#ip-192-168-2-59:~/octanktrips$ sudo mvn tomcat7:deploy
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.octank.travels:octanktrips:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.tomcat.maven:tomcat7-maven-plugin is missing. # line 26, column 9
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building octanktrips 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:deploy (default-cli) # octanktrips >>>
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # octanktrips ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # octanktrips ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) # octanktrips ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/ubuntu/octanktrips/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # octanktrips ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # octanktrips ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/ubuntu/octanktrips/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) # octanktrips ---
[INFO] Packaging webapp
[INFO] Assembling webapp [octanktrips] in [/home/ubuntu/octanktrips/target/octanktrips]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ubuntu/octanktrips/src/main/webapp]
[INFO] Webapp assembled in [182 msecs]
[INFO] Building war: /home/ubuntu/octanktrips/target/octanktrips.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) # octanktrips <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) # octanktrips ---
[INFO] Deploying war to http://localhost:8080/octanktrips
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Uploading: http://localhost:8080/manager/text/deploy?path=%2Foctanktrips
2/45491 KB
Uploading: http://localhost:8080/manager/text/deploy?path=%2Foctanktrips
2/45491 KB
Uploading: http://localhost:8080/manager/text/deploy?path=%2Foctanktrips
2/45491 KB
Uploading: http://localhost:8080/manager/text/deploy?path=%2Foctanktrips
2/45491 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.777s
[INFO] Finished at: Fri Sep 23 03:33:26 UTC 2016
[INFO] Final Memory: 14M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project octanktrips: Cannot invoke Tomcat manager: Broken pipe -> [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
Here 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>org.octank.travels</groupId>
<artifactId>octanktrips</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>octanktrips</name>
<build>
<finalName>octanktrips</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcatserver</server>
<path>/octanktrips</path>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<!-- uncomment this to get JSON support
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency>
-->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.22</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency>
</dependencies>
<properties>
<jersey.version>2.16</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Here is my /etc/maven/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
| and is normally provided in ${user.home}/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -s /path/to/user/settings.xml
|
| 2. Global Level. This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| ${maven.home}/conf/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -gs /path/to/global/settings.xml
|
| The sections in this sample file are intended to give you a running start at
| getting the most out of your Maven installation. Where appropriate, the default
| values (values used when the setting is not specified) are provided.
|
|-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</interactiveMode>
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
<offline>false</offline>
-->
<!-- pluginGroups
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|-->
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
-->
<server>
<id>tomcatserver</id>
<username>admin</username>
<password>admin</password>
</server>
<!-- Another sample, using keys to authenticate.
<server>
<id>siteServer</id>
<privateKey>/path/to/private/key</privateKey>
<passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
</servers>
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
| repositories, plugin repositories, and free-form properties to be used as configuration
| variables for plugins in the POM.
|
|-->
<profiles>
<!-- profile
| Specifies a set of introductions to the build process, to be activated using one or more of the
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
| or the command line, profiles have to have an ID that is unique.
|
| An encouraged best practice for profile identification is to use a consistent naming convention
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
| This will make it more intuitive to understand what the set of introduced profiles is attempting
| to accomplish, particularly when you only have a list of profile id's for debug.
|
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
<profile>
<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>jdk14</id>
<name>Repository for JDK 1.4 builds</name>
<url>http://www.myhost.com/maven/jdk14</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
-->
<!--
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
| might hypothetically look like:
|
| ...
| <plugin>
| <groupId>org.myco.myplugins</groupId>
| <artifactId>myplugin</artifactId>
|
| <configuration>
| <tomcatLocation>${tomcatPath}</tomcatLocation>
| </configuration>
| </plugin>
| ...
|
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
| anything, you could just leave off the <value/> inside the activation-property.
|
<profile>
<id>env-dev</id>
<activation>
<property>
<name>target-env</name>
<value>dev</value>
</property>
</activation>
<properties>
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
</properties>
</profile>
-->
</profiles>
<!-- activeProfiles
| List of profiles that are active for all builds.
|
<activeProfiles>
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
</activeProfiles>
-->
</settings>
Here is my tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager,manager-script,manager-gui"/>
</tomcat-users>
Here is the output of my /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/jre/bin"
export JAVA_HOME
Here is the output of java -version
java version "1.7.0_111"
OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)
I know it’s been a while and you may have probably moved on or solved the issue, but just for reference for other users, it usually helps to debug your problems to use curl like this:
curl -i -X PUT -u user:pass http://localhost:8080/manager/text/deploy?path=/<your_context> --upload-file <your_app>.war
And see what’s going on from the headers output.

Maven - Reactors (Aggregation)

I have a maven project with a following directory structure:
trunk
| pom.xml
| coreutils
| | pom.xml
| | src
| budgetCap
| | pom.xml
| | src
The content of trunk/pom.xml is :
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
hxttp://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Ant2Maven</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Parent Pom</name>
<modules>
<module>coreutils</module>
<module>budgetCap</module>
</modules>
In this structure, "budgetCap" is dependent on "coreutils",i.e. pom.xml of "budgetCap" contains a dependency of "coreutils"
Now I have two methods to build this project
First Method
Aggregation using Reactor
I will be inside trunk
So first of all I do mvn clean
shakim:trunk shakim.md$ mvn clean
Maven deletes the target folder of the two module in this order:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] coreutils
[INFO] budgetCap Maven Webapp
[INFO] Parent Pom
Now when i do mvn install
shakim:trunk shakim.md$ mvn install
Maven starts building modules in the following order:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] coreutils
[INFO] budgetCap Maven Webapp
[INFO] Parent Pom
In the given order, coreutils gets installed in the local repository successfully.
But budgetCap fails at the compilation giving an error that maven is unable to locate a class which was supposed to be produced by coreutils
the error message is as follows:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building budgetCap Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # budgetCap ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # budgetCap ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING]/Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java: /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java uses unchecked or unsafe operations.
[WARNING]/Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/BudgetCapServer.java:[41,34] package com.adiquity.request.utils does not exist
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/utils/Utils.java:[9,34] package com.adiquity.request.utils does not exist
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/log/data/parser/ConversionParser.java:[16,34] package com.adiquity.request.utils does not exist
Briefly speaking this package package com.adiquity.request.utils is actually present in coreutils, which this module budgetCap must have located successfully, but it is not.
Second Method
Go inside coreutils and do a
shakim:coreutils shakim.md$ mvn clean install
Go inside budgetCap and do a
shakim:budgetCap shakim.md$ mvn clean install
budgetCap compiles successfully without reporting any kind of error.
My question is that I want to use Reactors in Maven and I am unable to figure out why the build fails on using 1st method whereas 2nd method of building completes smoothly??
I am not sure how to use reactors, do we need to include anything in pom of coreutils and budgetCap signifying that pom of trunk is the parent.
Note: I don't want to use inheritance in this project

How to indicate active profiles in the Maven Reactor Summary?

At the end of my Maven build I see the following:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ABC ............................................... SUCCESS [0.915s]
[INFO] ABC - Common ...................................... SUCCESS [1.435s]
[INFO] ABC - Database .................................... SUCCESS [0.202s]
[INFO] ABC - Entities .................................... SUCCESS [9.158s]
[INFO] ABC - Entity Services ............................. SUCCESS [0.200s]
[INFO] ABC - Web Application ............................. SUCCESS [1.738s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
I'm using profiles in some of the modules, e.g. to specify whether stubs and database generation are applied. Would like to quickly see whether these profiles have been activated. Thought it might be possible to do this by changing the project artifact name - e.g:
<profiles>
<profile>
<id>stubbed</id>
<name>ABC - Entity Services [STUBBED]</name>
</profile>
</profiles>
But Maven doesn't allow this. Is there an alternative way?
Not sure if I got your question correctly. If not, please rephrase or comment.
You can see active profiles with the maven-help-plugin's active-profiles mojo. Use it like this:
mvn help:active-profiles
Does this answer your question?

Resources