Skip to content

Update maven install #10

Closed
Closed

Description

@zloster

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.

Activity

  1. zloster commented on Mar 31, 2017

    @zloster
    OwnerAuthor

    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.

  2. modified the milestone: on Apr 1, 2017
  3. self-assigned this
    on Jun 21, 2017
  4. modified the milestones: , Toolset updates on Jun 21, 2017
  5. added
    пече се
    on Jun 21, 2017
  6. zloster commented on Jun 21, 2017

    @zloster
    OwnerAuthor

    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!
  7. zloster commented on Jun 22, 2017

    @zloster
    OwnerAuthor

    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.

  8. zloster commented on Jun 25, 2017

    @zloster
    OwnerAuthor

    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.

  9. removed
    пече се
    on Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions