Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update maven install #10

Closed
zloster opened this issue Mar 29, 2017 · 5 comments
Closed

Update maven install #10

zloster opened this issue Mar 29, 2017 · 5 comments
Assignees

Comments

@zloster
Copy link
Owner

zloster commented Mar 29, 2017

Currently tbf is using nonofficial PPA for the maven: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/systools/maven.sh#L5
Newer maven packages should be available in the more recent Ubuntu versions from the official repositories. Check what is available.

@zloster
Copy link
Owner Author

zloster commented Mar 29, 2017

So the PPA is maven 3.2.1 (http://ppa.launchpad.net/natecarlson/maven3/ubuntu/dists/precise/main/binary-amd64/Packages).
In Trusty maven is 3.0.5 (http://packages.ubuntu.com/trusty/maven).
In Xenial maven is 3.3.9 (http://packages.ubuntu.com/xenial/maven).
Ubuntu Precise will be discontinued after 2 months in the end of May 2017. So there is no point to try to support the older versions of Ubuntu.

@zloster
Copy link
Owner Author

zloster commented Mar 31, 2017

These lines can be used to install maven: https://github.com/carlossg/docker-maven/blob/master/jdk-8/Dockerfile#L5-L13
Changing the mirror URL is recommended. Also adding gpg signing check.

@zloster zloster modified the milestone: BetterTimes Apr 1, 2017
@zloster zloster self-assigned this Jun 21, 2017
@zloster zloster modified the milestones: BetterTimes, Toolset updates Jun 21, 2017
@zloster zloster added the пече се Работи се по това label Jun 21, 2017
@zloster
Copy link
Owner Author

zloster commented Jun 21, 2017

Ask Apache for their closest mirror so we could speak to it.

wget -qO - http://www.apache.org/dyn/closer.lua?as_json=1 | grep -P '"preferred": "' | cut -d \" -f4
  1. ?as_json=1 I don't know where it is documented. Some answer of (Shit)StackOverflow. TODO find it.
  2. -q makes wget quiet, O makes it output to std stream;
  3. -P is for GNU grep. We just get one line from the JSON;
  4. cut all " and get the 4 column and voala!

@zloster
Copy link
Owner Author

zloster commented Jun 22, 2017

So far the result:

vagrant@tfb-all:~$ cat maven3.5.sh
#!/bin/bash

fw_installed maven && return 0

MAVEN_VERSION=3.5.0

# Ask Apache for the preferred mirror for our connection using JSON response. Source: https://stackoverflow.com/a/39670213
MAVEN_MIRROR="$(wget -qO - http://www.apache.org/dyn/closer.lua?as_json=1 | grep -P '"preferred": "' | cut -d \" -f4)"
MAVEN_FILENAME=apache-maven-${MAVEN_VERSION}-bin
MAVEN_URL=${MAVEN_MIRROR}maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_FILENAME}.tar.gz
MAVEN_SIGNATURE=https://www.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_FILENAME}.tar.gz.asc

APACHE_KEYS=https://www.apache.org/dist/maven/KEYS

# Download the files at temporal storage
wget -P /tmp ${APACHE_KEYS}
wget -P /tmp ${MAVEN_SIGNATURE}
wget -P /tmp ${MAVEN_URL}

# It's highly unlikely Apache to change the filename of the GPG keys file
gpg --import /tmp/KEYS

# Verify the downloaded file using the signature file
gpg --verify /tmp/${MAVEN_FILENAME}.tar.gz.asc /tmp/${MAVEN_FILENAME}.tar.gz

# Create the installation directory and don't complain if it exists
sudo mkdir -p /usr/share/maven3
sudo tar -xzf /tmp/${MAVEN_FILENAME}.tar.gz -C /usr/share/maven3 --strip-components=1

echo "export PATH=/usr/share/maven3/bin:\$PATH" > $IROOT/maven.installed

source $IROOT/maven.installed

mvn -version

# Clean up the temp files
rm -r ~/.gnupg/
rm /tmp/KEYS /tmp/${MAVEN_FILENAME}.tar.gz.asc /tmp/${MAVEN_FILENAME}.tar.gz

TODO: If the target /usr/share/maven3 directory exists tar is not overwriting files. So this directory should be cleared. But: is it a good idea? If the target directory is not deleted there will be version clash if a different Maven version is installed.

@zloster
Copy link
Owner Author

zloster commented Jun 25, 2017

The branch is ready for pull request. Pull request created.
Edit: there are two failures in Travis but they don't seem to be related with the update.
Edit: Pull request accepted.

@zloster zloster removed the пече се Работи се по това label Jun 26, 2017
@zloster zloster closed this as completed Jun 27, 2017
zloster pushed a commit that referenced this issue Oct 2, 2018
Here's an example of the error output from before this change:

Unhandled exception:
Bad state: Stream was already listened to
#0      _RawServerSocket.listen (dart:io-patch/socket_patch.dart:1106)
#1      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:123)
#2      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:91)
#3      _ForwardingStream.listen (dart:async/stream_pipe.dart:86)
#4      _ServerSocket.listen (dart:io-patch/socket_patch.dart:1351)
#5      _HttpServer.listen (dart:io/http_impl.dart:2278)
#6      _startServer.<anonymous closure> (file:///server.dart:88:12)
#7      _RootZone.runUnary (dart:async/zone.dart:1371)
#8      _FutureListener.handleValue (dart:async/future_impl.dart:129)
#9      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#10     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#11     _Future._completeWithValue (dart:async/future_impl.dart:478)
#12     Future.wait.<anonymous closure> (dart:async/future.dart:362)
#13     _RootZone.runUnary (dart:async/zone.dart:1371)
#14     _FutureListener.handleValue (dart:async/future_impl.dart:129)
#15     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#16     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#17     _Future._completeWithValue (dart:async/future_impl.dart:478)
#18     Future.wait.<anonymous closure> (dart:async/future.dart:362)
#19     _RootZone.runUnary (dart:async/zone.dart:1371)
#20     _FutureListener.handleValue (dart:async/future_impl.dart:129)
#21     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:636)
#22     _Future._propagateToListeners (dart:async/future_impl.dart:665)
#23     _Future._completeWithValue (dart:async/future_impl.dart:478)
#24     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:510)
#25     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#26     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#27     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:99)
#28     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:152)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant