Monday, October 15, 2018

backing up the Nexus configuration

Using the built-in procedure is risky - to say the least. I was unable to make it work (the restore part, I mean).

You can do this (see https://stackoverflow.com/a/45986526/651288 ):

java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar

CONNECT create database plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component admin admin

#to export, use this:
export database component-export



#to import, use this:
drop database
create database plocal:/home/centos/nexus310/sonatype-work/nexus3/db/component
import database component-export.json.gz


I also do this:

gunzip component-export.json.gz
python -m json.tool component-export.json > component-exportPRETTY.json


and the JSON file is quite readable, probably you can even stick it into a Git repo and relax.

From an operational point of view, Nexus 3 is simply a joke.

Installing JIRA

https://www.atlassian.com/software/jira/download
Linux 64 bit

cd Downloads
sudo ./atlassian-jira-software-7.12.3-x64.bin
Unpacking JRE ...
Starting Installer ...

This will install JIRA Software 7.12.3 on your computer.
OK [o, Enter], Cancel [c]

Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
1
Details on where JIRA Software will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/jira 
Home Directory: /var/atlassian/application-data/jira 
HTTP Port: 8080 
RMI Port: 8005 
Install as service: Yes 
Install [i, Enter], Exit [e]
i

Extracting files ...
                                                                           

Please wait a few moments while JIRA Software is configured.
Installation of JIRA Software 7.12.3 is complete
Start JIRA Software 7.12.3 now?
Yes [y, Enter], No [n]
y

Please wait a few moments while JIRA Software starts up.
Launching JIRA Software ...
Installation of JIRA Software 7.12.3 is complete
Your installation of JIRA Software 7.12.3 is now ready and can be accessed
via your browser.
JIRA Software 7.12.3 can be accessed at http://localhost:8080
Finishing installation ...


http://localhost:8080

generating the evaluation license key is very simple (you should create an account with Atlassian)

the product is installed for user "jira":
sudo su - jira

logs are in /opt/atlassian/jira/logs/


To troubleshoot webhooks, you should enable DEBUG loggin as default in http://localhost:8080/secure/admin/ViewLogging.jspa
then you see the webhook body being traced in /opt/atlassian/jira/logs/catalina.out

Start and stop:
sudo /etc/init.d/jira start
sudo /etc/init.d/jira stop





More JIRA on Docker

See also https://www.javamonamour.org/2017/11/jira-on-docker-and-integration-with.html


docker run -d -p 8080:8080 cptactionhank/atlassian-jira:7.7.0


I need to install netstat, but I have no root access (root pw is not given), so I do:

docker exec -ti --user root elastic_agnesi /bin/sh

and I get this strange error:

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "chdir to cwd (\"/var/atlassian/jira\") set in config.json failed: permission denied": unknown


woorkaround:

docker exec -ti elastic_agnesi /bin/sh
chmod 777 .
chmod 777 ..
exit

and try again connecting as root.... I have no idea why, but this time it works....

Then as root do

apt install net-tools

Then I discover that only tcp (not tcp6) ports are available, because the image doesn't support IPv6 : "cat /proc/net/if_inet6" returns nothing.

Now I start my webhook intercepting application with IPv4

java -Djava.net.preferIPv4Stack=true -jar bla.jar

before:

[centos@localhost ~]$ netstat -an | grep 8090
tcp6 0 0 :::8090 :::* LISTEN

after:

[centos@localhost ~]$ netstat -an | grep 8090
tcp 0 0 0.0.0.0:8090 0.0.0.0:* LISTEN

but still curl -X POST http://localhost:8090/greeting is not working... I am giving up and will install JIRA directly on host....







Wednesday, October 10, 2018

Nexus Groovy scripting

Huge issue in Nexus is that you can't export/import your Users/Groups/Privileges and Repository configuration. All you can do is to take a "backup", which ends of in a folder as a completely unreadable/unversionable format.

So I was looking for

when you run a Groovy script in Nexus, you have available a predefined variable "repository", which is of type org.sonatype.nexus.script.plugin.internal.provisioning.RepositoryApiImpl

This in turn contains a reference to a blobStoreManager org.sonatype.nexus.blobstore.api.BlobStoreManager and to a repositoryManager org.sonatype.nexus.repository.manager.RepositoryManager , plus a series of convenience methods to create commonly used repository formats (you are not expected to create anything fancy, most properties are assigned by default) and groups.

Key element is a org.sonatype.nexus.repository.config.Configuration object, again very disappointing since the configuration is represented by a "attribute" map (String, Map(String, Object)) which is really a stupid idea, too generic interface.

RepositoryManager has a Iterable<Repository> browse(); which returns a collection of org.sonatype.nexus.repository.Repository

Sample script:

import org.sonatype.nexus.repository.Repository

repository.repositoryManager.browse().each { Repository repo ->
    log.info("Repository: $repo")
    log.info("Repository Configuration: $repo.configuration")
}


this dumps in nexus.log the following content:

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=proxy, format=nuget, name='nuget.org-proxy'}
Repository Configuration: Configuration{repositoryName='nuget.org-proxy', recipeName='nuget-proxy', attributes={proxy={strictContentTypeValidation=true, contentMaxAge=1440, remoteUrl=https://www.nuget.org/api/v2/, metadataMaxAge=1440}, negativeCache={}, storage={blobStoreName=default}, nugetProxy={}, httpclient={connection={blocked=false, autoBlock=true}}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=hosted, format=maven2, name='maven-releases'}
Repository Configuration: Configuration{repositoryName='maven-releases', recipeName='maven2-hosted', attributes={maven={versionPolicy=RELEASE, layoutPolicy=STRICT}, storage={writePolicy=ALLOW_ONCE, strictContentTypeValidation=false, blobStoreName=default}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=hosted, format=maven2, name='maven-snapshots'}
Repository Configuration: Configuration{repositoryName='maven-snapshots', recipeName='maven2-hosted', attributes={maven={versionPolicy=SNAPSHOT, layoutPolicy=STRICT}, storage={writePolicy=ALLOW, strictContentTypeValidation=false, blobStoreName=default}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=proxy, format=maven2, name='maven-central'}
Repository Configuration: Configuration{repositoryName='maven-central', recipeName='maven2-proxy', attributes={proxy={contentMaxAge=-1, remoteUrl=https://repo1.maven.org/maven2/, metadataMaxAge=1440}, negativeCache={timeToLive=1440, enabled=true}, storage={strictContentTypeValidation=false, blobStoreName=default}, maven-indexer={}, httpclient={connection={blocked=false, autoBlock=true}}, maven={versionPolicy=RELEASE, layoutPolicy=PERMISSIVE}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=group, format=nuget, name='nuget-group'}
Repository Configuration: Configuration{repositoryName='nuget-group', recipeName='nuget-group', attributes={storage={blobStoreName=default}, nugetProxy={}, httpclient={}, group={memberNames=[nuget-hosted, nuget.org-proxy]}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=hosted, format=nuget, name='nuget-hosted'}
Repository Configuration: Configuration{repositoryName='nuget-hosted', recipeName='nuget-hosted', attributes={storage={writePolicy=ALLOW, blobStoreName=default}}}

Repository: RepositoryImpl$$EnhancerByGuice$$c5f0822b{type=group, format=maven2, name='maven-public'}
Repository Configuration: Configuration{repositoryName='maven-public', recipeName='maven2-group', attributes={maven={versionPolicy=MIXED}, group={memberNames=[maven-releases, maven-snapshots, maven-central]}, storage={blobStoreName=default}}}





which is pretty good result, at least you can capture in one go all the configuration of all your repositories.



This task will delete all your repos:

import org.sonatype.nexus.repository.Repository

repository.repositoryManager.browse().each { Repository repo ->
    log.info("DELETE Repository: $repo")
    repository.repositoryManager.delete("$repo.name")
}


All the predefined variables are

core which is a org.sonatype.nexus.internal.provisioning.CoreApiImpl

repository which is a org.sonatype.nexus.script.plugin.internal.provisioning.RepositoryApiImpl

blobStore which is a org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl
createFileBlobStore(final String name, final String path)
org.sonatype.nexus.blobstore.api.BlobStoreManager blobStoreManager 

security which is a org.sonatype.nexus.security.internal.SecurityApiImpl
User addUser(final String id, final String firstName, final String lastName, final String email, final boolean active,
final String password, final List roleIds)
Role addRole(final String id, final String name, final String description, final List privileges,
final List roles)
User setUserRoles(final String userId, final List roleIds)


Good is that if you clone the github repo nexus-book-examples you can directly open the APIs in file:///home/centos/gitclones/nexus-book-examples/scripting/apidocs/index.html


List all users with their roles

import groovy.json.JsonOutput
users = security.getSecuritySystem().listUsers()
userjson = JsonOutput.toJson(users)
log.info("USERS $userjson")





Eclipse jee-2018-09 hangs upon restarting

Eclipse jee-2018-09 hangs upon restarting

I do a "ps -ef | grep -i eclipse" then a jstack on the process, to find out that:

ModalContext" #136 prio=6 os_prio=0 tid=0x00007fbe7885f000 nid=0x2744 waiting for monitor entry [0x00007fbdc980f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
 at org.eclipse.swt.widgets.Display.asyncExec(Display.java:866)
 - waiting to lock <0x00000000c030b110> (a java.lang.Class for org.eclipse.swt.graphics.Device)
 at org.eclipse.jface.operation.AccumulatingProgressMonitor.beginTask(AccumulatingProgressMonitor.java:146)
 at org.eclipse.core.runtime.ProgressMonitorWrapper.beginTask(ProgressMonitorWrapper.java:51)
 at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor$CancelableProgressMonitorWrapper.beginTask(IDEWorkbenchAdvisor.java:463)
 at org.eclipse.core.runtime.ProgressMonitorWrapper.beginTask(ProgressMonitorWrapper.java:51)
 at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1157)
 at org.eclipse.core.internal.resources.Workspace.save(Workspace.java:2335)
 at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor$5.run(IDEWorkbenchAdvisor.java:529)
 at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)


"Worker-33: Building workspace" #133 prio=5 os_prio=0 tid=0x00007fbe54f7b800 nid=0x2731 waiting for monitor entry [0x00007fbdf8133000]
   java.lang.Thread.State: BLOCKED (on object monitor)
 at org.eclipse.swt.graphics.Device.isDisposed(Device.java:835)
 - waiting to lock <0x00000000c030b110> (a java.lang.Class for org.eclipse.swt.graphics.Device)
 at org.eclipse.ui.internal.UILockListener.isUI(UILockListener.java:188)
 at org.eclipse.ui.internal.UILockListener.aboutToRelease(UILockListener.java:123)
 at org.eclipse.core.internal.jobs.LockManager.aboutToRelease(LockManager.java:92)
 at org.eclipse.core.internal.jobs.OrderedLock.doRelease(OrderedLock.java:189)
 - locked <0x00000000c648be58> (a org.eclipse.core.internal.jobs.OrderedLock)
 at org.eclipse.core.internal.jobs.OrderedLock.release(OrderedLock.java:237)
 at org.eclipse.core.internal.resources.WorkManager.beginUnprotected(WorkManager.java:109)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2291)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2319)
 at org.eclipse.wst.jsdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2162)
 at org.eclipse.wst.jsdt.internal.core.JavaModelManager.getJsGlobalScopeContainer(JavaModelManager.java:1536)
 at org.eclipse.wst.jsdt.core.JavaScriptCore.getJsGlobalScopeContainer(JavaScriptCore.java:1358)
 at org.eclipse.wst.jsdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2748)
 at org.eclipse.wst.jsdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2027)
 at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.validateClasspaths(DeltaProcessor.java:2264)
 at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1950)
 at org.eclipse.wst.jsdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:389)
 at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:300)
 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
 at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:290)
 at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:153)
 at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:365)
 at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:141)
 at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)



it seems related to this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=522174

Just kill the bastard and move on.


Eclipse is a total piece of shit - they should simply rewrite it from scratch using a better design. Time invested in maintaining this old elephant is totally wasted.






Nexus programmatically create Repositories

Nexus API sucks - big time.

This https://blog.sonatype.com/automated-setup-of-a-repository-manager is a desperate attempt to automate stuff.


git clone https://github.com/sonatype/nexus-book-examples.git
cd ./nexus-book-examples/scripting/complex-script

docker run -d -p 8081:8081 --name nexus sonatype/nexus3:3.10.0
see https://hub.docker.com/r/sonatype/nexus3/tags/

check the logs by
docker exec -ti nexus /bin/bash
more /opt/sonatype/sonatype-work/nexus3/log/nexus.log


rm -rf /home/centos/.groovy/grapes/
rm -rf /home/centos/.m2/repository/



You can easily test your scripts from the Nexus UI (create execute script UI) , and also debut them remotely from Intellij :

https://support.sonatype.com/hc/en-us/articles/115015812727-Nexus-3-Groovy-Script-development-environment-setup


Try running this script:

repository.createMavenHosted('pippo')

it can't be easier!


The RepositoryAPI is available here

https://github.com/sonatype/nexus-public/blob/master/plugins/nexus-script-plugin/src/main/java/org/sonatype/nexus/script/plugin/RepositoryApi.java

Repository createMavenHosted(final String name,
final String blobStoreName,
final boolean strictContentTypeValidation,
final VersionPolicy versionPolicy,
final WritePolicy writePolicy,
final LayoutPolicy layoutPolicy);

example:


repository.createMavenHosted('private-again', 'default', true, org.sonatype.nexus.repository.maven.policy.VersionPolicy.SNAPSHOT, org.sonatype.nexus.repository.storage.WritePolicy.ALLOW_ONCE, org.sonatype.nexus.repository.maven.LayoutPolicy.STRICT)



To list repositories (unfortunately it returns only partial information about the Repository):

curl -X GET --header 'Accept: application/json' 'http://localhost:8081/service/rest/beta/repositories'


[ {
  "name" : "nuget.org-proxy",
  "format" : "nuget",
  "type" : "proxy",
  "url" : "http://localhost:8081/repository/nuget.org-proxy"
}, {
  "name" : "maven-releases",
  "format" : "maven2",
  "type" : "hosted",
  "url" : "http://localhost:8081/repository/maven-releases"
}, {
  "name" : "maven-snapshots",
  "format" : "maven2",
  "type" : "hosted",
  "url" : "http://localhost:8081/repository/maven-snapshots"
}, {
  "name" : "maven-central",
  "format" : "maven2",
  "type" : "proxy",
  "url" : "http://localhost:8081/repository/maven-central"
}, {
  "name" : "nuget-group",
  "format" : "nuget",
  "type" : "group",
  "url" : "http://localhost:8081/repository/nuget-group"
}, {
  "name" : "nuget-hosted",
  "format" : "nuget",
  "type" : "hosted",
  "url" : "http://localhost:8081/repository/nuget-hosted"
}, {
  "name" : "maven-public",
  "format" : "maven2",
  "type" : "group",
  "url" : "http://localhost:8081/repository/maven-public"
} ]


Ref: https://help.sonatype.com/repomanager3/rest-and-integration-api/script-api/writing-scripts about Groovy Scripting in Nexus




Tuesday, October 9, 2018

centos filesystem ntfs not configured in kernel

trying to install an external HD (Windows formatted) on a Centos box...

centos@localhost ~]$ sudo fdisk -l /dev/sdc2

Disk /dev/sdc2: 4000.7 GB, 4000650887168 bytes, 7813771264 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disk label type: dos
Disk identifier: 0x6e697373

This doesn't look like a partition table
Probably you selected the wrong device.

     Device Boot      Start         End      Blocks   Id  System
/dev/sdc2p1   ?  1936269394  3772285809   918008208   4f  QNX4.x 3rd part
Partition 1 does not start on physical sector boundary.
/dev/sdc2p2   ?  1917848077  2462285169   272218546+  73  Unknown
Partition 2 does not start on physical sector boundary.
/dev/sdc2p3   ?  1818575915  2362751050   272087568   2b  Unknown
Partition 3 does not start on physical sector boundary.
/dev/sdc2p4   ?  2844524554  2844579527       27487   61  SpeedStor
Partition 4 does not start on physical sector boundary.

Partition table entries are not in disk order
[centos@localhost ~]$ 


sudo yum install epel-release

Package epel-release-7-11.noarch already installed and latest version
Nothing to do


find /lib/modules/ | grep ntfs


nothing is found!

sudo yum install ntfs-3g -y



and now it works! Great! New mountpoint is /run/media/centos/Seagate\ Expansion\ Drive/


REF:

https://www.rootusers.com/how-to-mount-a-windows-ntfs-disk-in-linux/




Sunday, September 30, 2018

Nexus and Groovy for Setup Automation

Amazingly few people automate their Nexus administration. I guess the fault lies mostly in the company behind Nexus, who does very little to make their API usable and well documented.

This post https://blog.soebes.de/blog/2017/10/02/nexus-scripted-setup/ made me discover this API:

https://github.com/sonatype/nexus-public/blob/master/plugins/nexus-script-plugin/src/main/java/org/sonatype/nexus/script/plugin/RepositoryApi.java

Very good reading also here https://support.sonatype.com/hc/en-us/articles/115015812727-Nexus-3-Groovy-Script-development-environment-setup about using the Nexus book examples to automate the execution of these Groovy/Java scripts.

References http://www.javamonamour.org/2018/03/nexus-repository-administration.html on same topic of Automation (via REST api)

Wednesday, September 26, 2018

git delete all tags matching a regex

this will delete all remote tags containig the "iap-copy" string (more complex cases can be achieved with egrep)


git clone myrepourl
cd myproject
git tag --list | grep iap-copy | sort > allnaughtytags.txt
for mytag in `cat allnaughtytags.txt`; do git push --delete origin $mytag ; done 

The method is very slow.... there are much faster ways, but this is very simple and reliable

tested with git 1.9.4




Friday, September 21, 2018

Parsing command line arguments in Spring etc

lots of frameworks are reported here:
https://stackoverflow.com/questions/367706/how-do-i-parse-command-line-arguments-in-java/


but eventually I just want to do it using Spring classes

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/env/SimpleCommandLinePropertySource.html

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/env/JOptCommandLinePropertySource.html

The advantage in Spring is that you can directly bind the command line arguments to attributes, there is an example here

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/env/CommandLinePropertySource.html



A very simple example:

package org.pierre.clidemo;

import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.SimpleCommandLinePropertySource;
import org.springframework.boot.CommandLineRunner;


@SpringBootApplication
public class DemoApplication implements CommandLineRunner {

 public static void main(String[] args) {
  SpringApplication.run(DemoApplication.class, args);
 }

 @Override
 public void run(String... args) throws Exception {
  PropertySource ps = new SimpleCommandLinePropertySource(args);
  // --file=pippo.txt --language=EN_TO_DE --firstOriginal=true
  System.out.println("file=" + ps.getProperty("file"));
  System.out.println("language=" + ps.getProperty("language"));
  System.out.println("firstOriginal=" + ps.getProperty("firstOriginal"));
 }
}



and of course the JOptCommandLinePropertySource version is more robust...


Interesting also the https://projects.spring.io/spring-shell/ project, but only to write CLI applications







Wednesday, September 19, 2018

Eclipse Linux Tools (Docker Plugin) source code

https://wiki.eclipse.org/Linux_Tools_Project/Git

git clone git://git.eclipse.org/gitroot/linuxtools/org.eclipse.linuxtools.git



jars are installed NOT under the Eclipse installation folder, BUT here

/home/centos/.p2/pool/features/org.eclipse.linuxtools.docker.feature_4.0.0.201806122135
/home/centos/.p2/pool/plugins/org.eclipse.linuxtools.docker.docs_4.0.0.201806122135.jar
/home/centos/.p2/pool/plugins/org.eclipse.linuxtools.docker.core_4.0.0.201806122135.jar
/home/centos/.p2/pool/plugins/org.eclipse.linuxtools.docker.editor_1.0.0.201806122135.jar
/home/centos/.p2/pool/plugins/org.eclipse.linuxtools.docker.ui_4.0.0.201806122135.jar


Here they explain how to submit a bug http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/about/

Unfortunately there is a bug in org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCopyTo

@Override
    public boolean performFinish() {
        boolean finished = mainPage.finish();
        if (finished) {
            target = mainPage.getDestination().toOSString();
            sources = mainPage.getFilesToCopy();
        }
        return finished;
    }

If you run Eclipse on Windows, and the docker daemon runs on Linux, the toOSString() formats any path into the Windows format, which is not recognized by Linux. So you can't specify "/var" because it will be turned into "\\var" which obviously fails on Linux.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=539239 bug submitted





Monday, September 17, 2018

Nexus Maven repository migration

I need to migrate a Nexus 2.14 Maven repository to Nexus 3.10.

Unfortunately the Nexus product doesn't care much about migrations... probably they believe that, once installed, their product is immovable, like a sick elephant.

With a Nexus 2.14 to Nexus 2.14 migration, the repository structure is so simple that you can do it with a rsync.
But Nexus 3.10 is a totally different beast.

Luckily there are people who wrote tools:


https://github.com/simpligility/maven-repository-tools



I have to migrate from http://localhost:8081/nexus/content/repositories/releases/ (Nexus 2.14) to http://localhost:8181/repository/releases/ (Nexus 3.10)

git clone https://github.com/simpligility/maven-repository-tools.git
cd maven-repository-tools
mvn package
java -jar maven-repository-provisioner/target/maven-repository-provisioner-1.3.2-SNAPSHOT-jar-with-dependencies.jar

java -jar maven-repository-provisioner/target/maven-repository-provisioner-1.3.2-SNAPSHOT-jar-with-dependencies.jar -s http://localhost:8081/nexus/content/repositories/releases/ -t http://localhost:8181/repository/releases/ -u admin -p admin123 -a org.pierre:pvjoinfacestest:war:1.0


tragically, the tool doesn't allow wildcards.... so you must know in advance the gav of ALL the artifacts you have to migrate.... my impression is also that the .war is not really uploaded!


I am trying this one https://github.com/DarthHater/nexus-repository-import-scripts

copy https://github.com/DarthHater/nexus-repository-import-scripts/blob/master/mavenimport.sh to my /home/centos/nexus214/sonatype-work/nexus/storage/releases folder, then run

./mavenimport.sh -r http://localhost:8181/repository/releases/ -u admin -p admin123

and it works!



Friday, September 14, 2018

NordVPN programmatic API

https://github.com/jjangsangy/nordvpn/blob/master/nordvpn/api.py

'address': '/user/address',
'config': '/files/zipv2',
'nameserver': '/dns/smart',
'server': '/server',
'stats': '/server/stats',
'user': '/user/databytoken'


list of all NordVPN servers:

https://api.nordvpn.com/server

0
id 98288
ip_address "103.236.151.2"
search_keywords []
categories […]
name "Indonesia #2"
domain "id2.nordvpn.com"
price 0
flag "ID"
country "Indonesia"
location
lat -6.174444
long 106.829444
load 55
features
ikev2 true
openvpn_udp true
openvpn_tcp true
socks true
proxy true
pptp false
l2tp false
openvpn_xor_udp false
openvpn_xor_tcp false
proxy_cybersec true
proxy_ssl true
proxy_ssl_cybersec true



return my current IP
https://api.nordvpn.com/user/address


https://api.nordvpn.com/files/zipv2 downloads a config.zip file (some 20 MB) full of .ovpn files, for each server, with PKI key to connect to the server


https://api.nordvpn.com/dns/smart returns a list of IPs, probably of the NordVPN dns server


https://api.nordvpn.com/user/databytoken


https://bitbucket.org/nordial/nordapi/overview here you find how to login into API :

https://bitbucket.org/nordial/nordapi/raw/dd4e918e84b66a7842cbbf2262ad4019ead2e877/nordtoy.py







Monday, September 3, 2018

Nexus HTTP/1.1 407 Proxy Authentication Required

While trying to connect to https://repo.typesafe.com/typesafe/ivy-releases/ and https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/ over a corporate proxy with these 2 sites whitelisted, we keep getting:


org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet - Exception org.sonatype.nexus.repository.proxy.ProxyServiceException: HTTP/1.1 407 Proxy Authentication Required checking remote for update, proxy repo ivyreleases_proxy failed to fetch com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml with status line HTTP/1.1 407 Proxy Authentication Required, content not in cache.



If you enable ROOT logging at DEBUG (menu Support/Logging in Nexus console) you will see that a redirect is taking place, but the LAZY Nexus developer only logs the message and not the additional ESSENTIAL parameters to understand what is going on https://github.com/sonatype/nexus-public/blob/master/components/nexus-repository/src/main/java/org/sonatype/nexus/repository/proxy/ProxyFacetSupport.java, that is a redirection to https://dl.bintray.com

2018-09-03 13:11:48,044+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet - Fetching: GET https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml HTTP/1.1
2018-09-03 13:11:48,046+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.httpclient.outbound - https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml > GET /typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml HTTP/1.1
2018-09-03 13:11:48,046+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection request: [route: {tls}->http://ourproxyserver:8080->https://repo.typesafe.com:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 200]
2018-09-03 13:11:48,046+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection leased: [id: 478][route: {tls}->http://ourproxyserver:8080->https://repo.typesafe.com:443][total kept alive: 0; route allocated: 1 of 20; total allocated: 1 of 200]
2018-09-03 13:11:48,448+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.httpclient.outbound - https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml < HTTP/1.1 302 Moved Temporarily @ 402.5 ms
2018-09-03 13:11:48,448+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection [id: 478][route: {tls}->http://ourproxyserver:8080->https://repo.typesafe.com:443] can be kept alive for 30.0 seconds
2018-09-03 13:11:48,449+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection released: [id: 478][route: {tls}->http://ourproxyserver:8080->https://repo.typesafe.com:443][total kept alive: 1; route allocated: 1 of 20; total allocated: 1 of 200]
2018-09-03 13:11:48,449+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.httpclient.outbound - https://dl.bintray.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml > GET /typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml HTTP/1.1
2018-09-03 13:11:48,449+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection request: [route: {tls}->http://ourproxyserver:8080->https://dl.bintray.com:443][total kept alive: 1; route allocated: 0 of 20; total allocated: 1 of 200]
2018-09-03 13:11:48,449+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection leased: [id: 479][route: {tls}->http://ourproxyserver:8080->https://dl.bintray.com:443][total kept alive: 1; route allocated: 1 of 20; total allocated: 2 of 200]
2018-09-03 13:11:48,466+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.internal.httpclient.SharedHttpClientConnectionManager - Connection released: [id: 479][route: {tls}->http://ourproxyserver:8080->https://dl.bintray.com:443][total kept alive: 1; route allocated: 0 of 20; total allocated: 1 of 200]
2018-09-03 13:11:48,466+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.httpclient.outbound - https://dl.bintray.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml < HTTP/1.1 407 Proxy Authentication Required @ 17.12 ms
2018-09-03 13:11:48,466+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet - Response: HttpResponseProxy{HTTP/1.1 407 Proxy Authentication Required [Proxy-Authenticate: NTLM, Cache-Control: no-cache, Pragma: no-cache, Content-Type: text/html; charset=utf-8, Proxy-Connection: close, Connection: close, Content-Length: 850] org.apache.http.entity.BufferedHttpEntity@3326370a}
2018-09-03 13:11:48,466+0200 DEBUG [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet - Status: HTTP/1.1 407 Proxy Authentication Required
2018-09-03 13:11:48,467+0200 WARN  [qtp46263989-6144]  *UNKNOWN org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet - Exception org.sonatype.nexus.repository.proxy.ProxyServiceException: HTTP/1.1 407 Proxy Authentication Required checking remote for update, proxy repo ivyreleases_proxy failed to fetch com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml with status line HTTP/1.1 407 Proxy Authentication Required, content not in cache.
org.sonatype.nexus.repository.proxy.ProxyServiceException: HTTP/1.1 407 Proxy Authentication Required
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.mayThrowProxyServiceException(ProxyFacetSupport.java:426)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:400)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:346)
 at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet.fetch(MavenProxyFacet.java:73)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.doGet(ProxyFacetSupport.java:220)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.lambda$1(ProxyFacetSupport.java:209)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport$$Lambda$269/1592429552.call(Unknown Source)
 at org.sonatype.nexus.repository.proxy.Cooperation$CooperatingFuture.download(Cooperation.java:262)
 at org.sonatype.nexus.repository.proxy.Cooperation.download(Cooperation.java:194)
 at org.sonatype.nexus.repository.proxy.Cooperation.cooperate(Cooperation.java:93)
 at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:201)
 at org.sonatype.nexus.repository.proxy.ProxyHandler.handle(ProxyHandler.java:49)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.storage.UnitOfWorkHandler.handle(UnitOfWorkHandler.java:39)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.handlers.ContentHeadersHandler.handle(ContentHeadersHandler.java:44)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.maven.internal.VersionPolicyHandler.handle(VersionPolicyHandler.java:61)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.http.PartialFetchHandler.handle(PartialFetchHandler.java:55)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.cache.NegativeCacheHandler.handle(NegativeCacheHandler.java:42)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.handlers.ConditionalRequestHandler.handle(ConditionalRequestHandler.java:72)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.assetdownloadcount.internal.AssetDownloadCountContributedHandler.handle(AssetDownloadCountContributedHandler.java:53)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at com.sonatype.nexus.clm.internal.QuarantineContributedHandler.handle(QuarantineContributedHandler.java:68)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at com.sonatype.nexus.usertoken.plugin.internal.UserTokenHandler.handle(UserTokenHandler.java:70)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.handlers.HandlerContributor.handle(HandlerContributor.java:67)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.handlers.ExceptionHandler.handle(ExceptionHandler.java:44)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.security.SecurityHandler.handle(SecurityHandler.java:52)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.handlers.TimingHandler.handle(TimingHandler.java:46)
 at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
 at org.sonatype.nexus.repository.view.Context.start(Context.java:114)
 at org.sonatype.nexus.repository.view.Router.dispatch(Router.java:64)
 at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:52)
 at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:43)
 at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:211)
 at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:173)
 at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.service(ViewServlet.java:126)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
 at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
 at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
 at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
 at com.google.inject.servlet.DynamicServletPipeline.service(DynamicServletPipeline.java:71)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
 at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
 at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
 at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
 at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
 at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
 at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
 at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:85)
 at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
 at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
 at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
 at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
 at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:101)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at org.sonatype.nexus.repository.httpbridge.internal.ExhaustRequestFilter.doFilter(ExhaustRequestFilter.java:71)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at com.sonatype.nexus.licensing.internal.LicensingRedirectFilter.doFilter(LicensingRedirectFilter.java:108)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at org.sonatype.nexus.internal.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:68)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at org.sonatype.nexus.internal.web.EnvironmentFilter.doFilter(EnvironmentFilter.java:102)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at org.sonatype.nexus.internal.web.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:98)
 at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
 at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DynamicFilterPipeline.java:104)
 at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
 at org.sonatype.nexus.bootstrap.osgi.DelegatingFilter.doFilter(DelegatingFilter.java:73)
 at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:175)
 at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 at org.eclipse.jetty.server.Server.handle(Server.java:530)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
 at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
 at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
 at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
 at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
 at java.lang.Thread.run(Thread.java:745)





For pypi.org , you might need to whitelist also https://files.pythonhosted.org:443






Friday, August 31, 2018

building .net applications on a docker image

The pain is that you can't run a Windows docker image on Linux. And Microsoft images with the .net libraries are all Windows.
Like this one https://hub.docker.com/r/compulim/msbuild/

BUT you can build a ubuntu-based docker builder image:

https://medium.com/@hudsonmendes/build-net-4-5-on-linux-in-5-minutes-and-see-what-it-is-like-848ea45fc667


it's available on docker hub as vernetto/ubuntudotnet:1.0

Ref: how to push to docker hub https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html

how to submit a container to an image and save it as tar https://docs.docker.com/engine/reference/commandline/save/#description


Monday, August 27, 2018

docker latest update fails miserably

sudo journalctl -xe

mkdir /run/containerd/io.containerd.runtime.v2.task/docker/dockerd: file exists: unknown


it seems a bug of the latest (nightly) release.... which was installed automatically by the Centos updates process.


I uninstall everything:

sudo yum remove docker docker-common docker-selinux docker-engine

Then I install

https://docs.docker.com/install/linux/docker-ce/centos/#set-up-the-repository

sudo yum-config-manager --disable docker-ce-edge

sudo yum install docker-ce
sudo systemctl enable docker
systemctl start docker

systemctl status docker.service

Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: devicemapper, overlay2; Please cleanup or explicit

sudo vi /usr/lib/systemd/system/docker.service

ExecStart=/usr/bin/dockerd -s=devicemapper -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

sudo systemctl daemon-reload
sudo systemctl start docker




Friday, August 24, 2018

Nexus 3.10 as Python pypi proxy

sudo yum -y update
sudo yum -y install python-pip
pip --help
pip -V
mkdir ~/.pip
cd .pip/
vi pip.conf

enter this:

[global]
index = http://localhost:8181/repository/pypi/
index-url = http://localhost:8181/repository/pypi/simple

Create a nexus Pypi proxy repo "pypi" pointing to https://pypi.org/ . Leave all the defaults as they are.

pip install lino-amici

this should populate your nexus:

Looking in indexes: http://localhost:8181/repository/pypi/simple
Collecting lino-amici
  Downloading http://localhost:8181/repository/pypi/packages/eb/c3/7bdd189fd446effe7ea61d2136dfaec478ec7c5b84f694c6b6e43656f319/lino-amici-18.8.0.tar.gz
Collecting lino-xl (from lino-amici)
  Downloading http://localhost:8181/repository/pypi/packages/02/34/6ab429aac3f80aa64fd00c8f3dd76a9ca9ecf25d7e03f1e48981c7031542/lino-xl-18.4.0.tar.gz (2.3MB)
    100% |████████████████████████████████| 2.3MB 92.2MB/s 
Collecting vobject (from lino-amici)
  Downloading http://localhost:8181/repository/pypi/packages/da/ce/27c48c0e39cc69ffe7f6e3751734f6073539bf18a0cfe564e973a3709a52/vobject-0.9.6.1.tar.gz (58kB)
    100% |████████████████████████████████| 61kB 19.8MB/s 
Collecting lino (from lino-xl->lino-amici)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=8181): Read timed out. (read timeout=15)",)': /repository/pypi/packages/68/9e/39e5e96b9b8273f0f29943cddd51873ec670657ccf9918727d97ca6628e2/lino-18.8.0.tar.gz
  Downloading http://localhost:8181/repository/pypi/packages/68/9e/39e5e96b9b8273f0f29943cddd51873ec670657ccf9918727d97ca6628e2/lino-18.8.0.tar.gz (10.6MB)
    100% |████████████████████████████████| 10.6MB 89.8MB/s 
Collecting odfpy (from lino-xl->lino-amici)
  Downloading http://localhost:8181/repository/pypi/packages/01/0f/c9971c99d0d06024a1652f467427ff3f1a1136237e5740da715c5b208a48/odfpy-1.3.6.tar.gz (691kB)
    100% |████████████████████████████████| 696kB 42.6MB/s 
Collecting bleach (from lino-xl->lino-amici)
  Downloading http://localhost:8181/repository/pypi/packages/94/aa/0f7ce53f8688bb9f80c0cffacc3964ddfe08321c509c0bfe5062848951f9/bleach-2.1.4-py2.py3-none-any.whl
Collecting weasyprint (from lino-xl->lino-amici)
  Downloading http://localhost:8181/repository/pypi/packages/7e/4c/cf2ec7abf7f84a2d1325d01dcac1d4bcb77f41117101fe564eb76952c65f/WeasyPrint-0.42.3.tar.gz (399kB)
    100% |████████████████████████████████| 409kB 37.7MB/s 
    Complete output from command python setup.py egg_info:
    error in WeasyPrint setup command: Invalid environment marker: python_version < "3.0"
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-sPdLGr/weasyprint/



No worries about the message about the python version.... I have 2.7.... not willing to upgrade for now...






Wednesday, August 22, 2018

shell input validation

shell scripting STINKS, and to make it better we should at least make it more robust.

For instance by validating input parameters

Arrays are a great and simple way to achieve this.

array=(pippo pluto topolino)
printf '%s ' "${array[@]}"
printf  '\n'
value=puppo
if [[ ! " ${array[@]} " =~ " ${value} " ]]; then
  echo "array doesnt contain value $value"
fi





Tuesday, August 14, 2018

Oracle DB Invalid Objects

Some usefuls commands to troubleshoot:

select count(*) from USER_OBJECTS where OBJECT_TYPE = 'TABLE';
select count(*) from user_objects where object_type='TYPE';
select count(*) from user_tables;

select * from USER_OBJECTS where STATUS = 'INVALID';



exec dbms_utility.compile_schema( 'MYUSER' );

alter package MYPACKAGE COMPILE;

alter package MYPACKAGE COMPILE BODY;

show errors;

select * from user_errors ;





References:

https://oracle-base.com/articles/misc/recompiling-invalid-schema-objects

https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:637156098168



Thursday, August 2, 2018

CDI and WELD suck

A @Stateless bean could not be injected because not found by WELD

org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type PersistenceService with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private com.pippo.pluto.paperino.rest.MafaldaController.persistenceService
  at com.pippo.pluto.paperino.rest.MafaldaController.persistenceService(MafaldaController.java:0)

 at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:362)
 at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)
 at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:137)
 at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:158)
 at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:501)
 at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:61)
 at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:59)
 at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
 at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
 at org.jboss.threads.JBossThread.run(JBossThread.java:320)

https://docs.jboss.org/author/display/WFLY10/CDI+Reference

Even if the bean is a session bean, the archive (.jar) is not an “explicit bean archives (basically any archive containing the beans.xml file)“ because it doesn’t contain a beans.xml file (only the war file has a beans.xml file).

Since CDI 1.1 an archive can be implicit : “An implicit bean archive is any archive that contains one or more classes annotated with a bean defining annotation (scope annotation) or one or more session beans.”. Implicit archives don’t need a beans.xml.

But by default “implicit” is disabled! To enable it, you can either do the jboss-all.xml trick or do the “subsystem=weld:write-attribute(name=require-bean-descriptor,value=true)” trick. See again https://docs.jboss.org/author/display/WFLY10/CDI+Reference for more details. Or, you can simply add a beans.xml to the JAR.


If all this sounds to you like complete chaos and needless complication, it’s because it is!


Sunday, July 22, 2018

Spring Boot Security 5 and Oauth2




https://github.com/jgrandja/springone2017-demo


Ultimate guide and examples:

https://docs.spring.io/spring-security/site/docs/5.1.0.M1/reference/htmlsingle/

https://github.com/spring-projects/spring-security/blob/5.1.0.M1/samples/boot/oauth2login/README.adoc



Here a very rich presentation on Oauth2:

https://ordina-jworks.github.io/microservices/2017/09/26/Secure-your-architecture-part1.html

https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2


Spring boot Oauth2 https://spring.io/guides/tutorials/spring-boot-oauth2/



A simple application: https://spring.io/guides/tutorials/spring-boot-oauth2/#_social_login_simple
Code is here https://github.com/spring-guides/tut-spring-boot-oauth2.git or also https://github.com/vernetto/springboottests/tree/master/ui

Here the OAuth2 specs https://tools.ietf.org/html/rfc6749#section-4

Nice simplified and compact presentation https://aaronparecki.com/oauth-2-simplified/


Baeldung example for Oauth2 here https://github.com/eugenp/tutorials/tree/master/spring-5 with explanation here http://www.baeldung.com/spring-security-5-oauth2-login








Thursday, July 12, 2018

Spring Boot and Netflix: Eureka Server

https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka


let's start with an empty Eureka Server:

https://start.spring.io/starter.zip?name=eurekatest&groupId=org.pierre&artifactId=eurekatest&version=1.0&description=mavenfilter&packageName=org.pierre.eurekatest&type=maven-project&packaging=jar&javaVersion=1.8&language=java&bootVersion=2.0.2.RELEASE

run it, and hit:

http://localhost:8761


We have some basic working examples here at https://github.com/netflix-spring-one

first we run the Eureka Server:

git clone https://github.com/netflix-spring-one/sample-eureka
cd sample-eureka
gradle build
java -jar ./build/libs/sample-eureka.jar


then a sample service

git clone https://github.com/netflix-spring-one/sample-recommendations.git
cd sample-recommendations
gradle build
java -jar build/libs/sample-recommendations.jar

download latest gradle from https://gradle.org/releases/, unzip it to E:/apps and make sure /e/apps/gradle-4.8/bin/gradle can be executed (I use gitBash shell)

in build.gradle, change apply plugin: 'spring-boot' into apply plugin: 'org.springframework.boot'

to build, simply run "gradle build"

all the dowloaded jars are in %HOME%\.gradle\caches\modules-2\files-2.1 (the equivalent of %HOME%/.m2/repository )

Recommendations runs at

curl http://localhost:8001/api/recommendations/jschneider

and Eureka Server at http://localhost:9000/











Wednesday, July 11, 2018

ELK docker

http://elk-docker.readthedocs.io/

you have to adjust permanently the max_map_count parameter:

sysctl -w vm.max_map_count=262144

(sysctl - configure kernel parameters at runtime)

ls /proc/sys/vm to get list of available parameters

sudo vi /etc/sysctl.conf
vm.max_map_count=262144

try starting the container like this:

sudo docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk

if it fails with this error:

waiting for Elasticsearch to be up (30/30)
Couln't start Elasticsearch. Exiting.

try allowing more time:

sudo docker run -e ES_CONNECT_RETRY=300 -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk

(see https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file )

then

http://127.0.0.1:5601/app/kibana KIBANA (you have to wait 1 minute for Kibana to come up)

http://127.0.0.1:9200/ Elasticsearch JSON

to create dummy entry:

docker exec -it elk /bin/bash
/opt/logstash/bin/logstash --path.data /tmp/logstash/data -e 'input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }'
this is a dummy entry
this is a dummy entry2
CTRL-C


Kibana logs : less /var/log/kibana/kibana5.log
Elasticsearch logs : less /var/log/elasticsearch/elasticsearch.log
Logstash logs: less /var/log/logstash/logstash-plain.log

tail -f /var/log/elasticsearch/elasticsearch.log /var/log/logstash/logstash-plain.log /var/log/kibana/kibana5.log



docker network create -d bridge elknet


good practical presentation of ELK:





Sunday, July 8, 2018

rsync in action

https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps

To play in full safety, let's run tests in a docker container!

docker run -dit --privileged --name centos centos
docker attach centos
yum install rsync
yum install openssh openssh-server openssh-clients openssl-libs
groupadd centos
useradd -g centos centos
su - centos
cd ~
mkdir dir1
mkdir dir2
touch dir1/file{1..100}

#the "n" flag is "try-run" only, "v" is verbose, "a" is copy also links and preserve times ownership etc
rsync -anv dir1/ dir2


see also https://www.rosehosting.com/blog/how-to-configure-and-use-openssh-on-centos-7/ to configure sshd

if you get "Failed to get D-Bus connection: Operation not permitted" when starting sshd, probably you are not running the container in privileged mode




remotely:

rsync -a dir1/ centos@localhost:/home/centos/dir2

to syncronize 2 folders upon deletion:

rm dir1/file99
#this will delete file99 also on dir2
rsync -anv --delete dir1/ centos@localhost:/home/centos/dir2




more flags: -z adds compression, -P adds progress report,

Tuesday, June 26, 2018

tired of curl weird syntax? try httpie

https://httpie.org/

https://github.com/jakubroztocil/httpie

much more intuitive IMHO



Learning Spring Boot second edition


Excellent book by Greg L. Turnquist - no blabla, just stuff. Much better than the incredibly verbose and blablaistic Spring in Action.


Sample code here https://github.com/PacktPublishing/Learning-Spring-Boot-2.0-Second-Edition

You need MongoDB installed (IMHO better than using the embedded, I had issues)

https://www.mongodb.com/download-center?jmp=nav#community

download and install MongoDB community to D:\Program Files\MongoDB\Server\3.0\bin.... data by default is in D:\data\db

cd D:\Program Files\MongoDB\Server\3.0\bin
./mongod (it uses port 27017 by default)
./mongo
show dbs
show collections
db.chapter.find()

and possibly RabbitMQ:

https://www.rabbitmq.com/download.html

How to use the initializer:

https://start.spring.io/starter.zip?name=pvlearningspringboot&groupId=com.greglturnquist.learningspringboot&artifactId=pvlearningspringboot&version=1.0&description=pvlearningspringboot&packageName=com.greglturnquist.learningspringboot&type=gradle-project&packaging=war&javaVersion=1.8&language=java&bootVersion=2.0.3.RELEASE&dependencies=lombok&dependencies=data-mongodb-reactive&dependencies=thymeleaf&dependencies=webflux





Thursday, June 21, 2018

Gradle and Nexus

download Gradle binaries

mkdir /home/centos/gradle
unzip -d /home/centos/gradle/ gradle-4.8-bin.zip
export PATH=$PATH:/home/centos/gradle/gradle-4.8/bin/
gradle -version
cd gitclones/
git clone https://github.com/buzdin/allure-junit5-course

cd allure-junit5-course/

vi build.gradle

replace

repositories {
jcenter()
}

with

repositories {
maven {
url "http://localhost:8181/repository/maven-public/"
}
}


if your "group" maven-public repository points only to Maven Central, the build will fail

rm -rf .gradle/
gradle build --refresh-dependencies --debug



> Could not resolve all artifacts for configuration ':classpath'.
> Could not find io.qameta.allure:allure-gradle:2.4.
Searched in the following locations:
- http://localhost:8181/repository/maven-public/io/qameta/allure/allure-gradle/2.4/allure-gradle-2.4.pom
- http://localhost:8181/repository/maven-public/io/qameta/allure/allure-gradle/2.4/allure-gradle-2.4.jar
Required by:
project :


If you add to the group also a Proxy Repo "jcenter" pointing to https://jcenter.bintray.com/, everything works





Wednesday, June 20, 2018

Zipkin and Sleuth distributed tracing

https://dzone.com/articles/microservices-part-6-distributed-tracing-with-spri

https://zipkin.io/


Sleuth concise presentation with example:



and code is here https://github.com/TechPrimers/spring-cloud-sleuth-example



This is a very nice real demo (not "helloworld") of Sleuth and ELK with Kibana






Sunday, June 10, 2018

Eclipse and Gradle

Importing an old Gradle project in Eclipse can be problematic. I get this error message when "import existing gradle build"

Spring Boot plugin requires Gradle 4.0 or later. The current version is Gradle 2.5


I the project's "gradle/wrapper/gradle-wrapper.properties" I replace

distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip

with

distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip


I download and install latest gradle 4.8 in E:\apps\gradle-4.8

In Eclipse, configure the Preferences/Gradle setting the Gradle User Home to E:\apps\gradle-4.8

I have installed "Buildship Eclipse plug-ins for Gradle" version 2.2.1


It's a real pity that the plugin doesn't offer an automatic resolution of the issue (upgrading to latest Gradle, and updating the project's settings", but in case of Eclipse we are just thankful it doesn't crash as it usually does. What a pathetic piece of crap Eclipse is, it's a shame for the whole IT community, I use it only because it's the official IDE at work.

Thursday, June 7, 2018

Browsermob as a whitelisting/blacklisting Proxy

http://bmp.lightbody.net/

https://github.com/lightbody/browsermob-proxy

It's based on our friend Littleproxy.

Its latest release it 2.1.6. It seems not much going on recently... no commits in last 8 months...

In our case, 2 APIs are interesting:

Sets a list of URL patterns to whitelist PUT /proxy/[port]/whitelist

Request Parameters:

regex - A comma separated list of regular expressions.

status - The HTTP status code to return for URLs that do not match the whitelist.



Set a URL to blacklist
PUT /proxy/[port]/blacklist

Request Parameters:

regex - The blacklist regular expression.

status - The HTTP status code to return for URLs that are blacklisted.

method - The regular expression for matching HTTP method (GET, POST, PUT, etc). Optional, by default processing all HTTP method.




Saturday, June 2, 2018

Spring Boot and H2

https://dzone.com/articles/spring-boot-and-spring-jdbc-with-h2

Example code is here:

https://github.com/in28minutes/spring-boot-examples/tree/master/spring-boot-2-jdbc-with-h2

you must add spring.h2.console.path=/h2 in the application.properties file

in a nutshell:

in pom.xml

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>


<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>


in application.properties

# Datasource
#spring.datasource.url=jdbc:h2:file:~/test
spring.datasource.url=jdbc:h2:file:~/mydb
spring.datasource.username=mydb
spring.datasource.password=mydb
spring.datasource.driver-class-name=org.h2.Driver

# H2
# Enabling H2 Console
spring.h2.console.path=/h2
spring.h2.console.enabled=true
#Turn Statistics on
spring.jpa.properties.hibernate.generate_statistics=true
logging.level.org.hibernate.stat=debug
# Show all queries
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.type=trace


#spring.jpa.generate-ddl=false
spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=validate


To implement a repository:


import org.springframework.data.repository.CrudRepository;

public interface QuarantineRepository extends CrudRepository<Quarantine, Long> {
List findBygav(String gav);

}


To use the repository in a @javax.inject.Named bean:

import javax.inject.Inject;
...

@Inject
QuarantineRepository quarantineRepository ;


where Quarantine is like this:


import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Quarantine {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String gav;

etc etc

}



Spring Boot 2 actuator ... priceless!

in application.properties, add this

management.endpoints.web.exposure.include=*
management.endpoint.shutdown.enabled=true


and restart. hit this:

http://localhost:8080/actuator/beans

You can see the definition of all the Spring beans


Tutorial here http://www.baeldung.com/spring-boot-actuators


http://localhost:8080/actuator/auditevents

http://localhost:8080/actuator/conditions

http://localhost:8080/actuator/configprops

http://localhost:8080/actuator/env

http://localhost:8080/actuator/flyway (fail)

http://localhost:8080/actuator/health

http://localhost:8080/actuator/heapdump , this will save a file heapdump, rename it to heapdump.hprof, then open it with Eclipse Memory Analyzer Tool (MemoryAnalyzer.exe on Windows)

http://localhost:8080/actuator/info

http://localhost:8080/actuator/liquibase (fail)

http://localhost:8080/actuator/logfile


http://localhost:8080/actuator/loggers

http://localhost:8080/actuator/threaddump

http://localhost:8080/actuator/metrics

http://localhost:8080/actuator/metrics/jvm.memory.max

http://localhost:8080/actuator/scheduledtasks

http://localhost:8080/actuator/httptrace

http://localhost:8080/actuator/mappings

http://localhost:8080/actuator/prometheus (fail)


http://localhost:8080/actuator/sessions (fail)

http://localhost:8080/actuator/shutdown (fail)

http://localhost:8080/actuator/jolokia (fail)






Friday, June 1, 2018

Nexus proxy to npm registry

https://nodejs.org/en/
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server


Install node.js

cd ~
wget http://nodejs.org/dist/v0.10.30/node-v0.10.30-linux-x64.tar.gz
sudo tar --strip-components 1 -xzvf node-v* -C /usr/local
node --version
npm

https://help.sonatype.com/repomanager3/node-packaged-modules-and-npm-registries

In nexus 3, create a Proxy NPM repo pointing to https://registry.npmjs.org and called npm-all


npm config set registry http://localhost:8081/repository/npm-all/
npm install --save-dev babel-loader babel-core babel-preset-env webpack


it works! I only get this error

engine p-try@1.0.0: wanted: {"node":">=4"} (current: {"node":"0.10.30","npm":"1.4.21"})
npm ERR! Error: Package 'webassemblyjs-ast' not found : repository/npm-all/webassemblyjs/ast
npm ERR!     at RegClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:300:14)
npm ERR!     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:238:65)
npm ERR!     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR!     at Request.emit (events.js:98:17)
npm ERR!     at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR!     at Request.emit (events.js:117:20)
npm ERR!     at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:844:12)
npm ERR!     at IncomingMessage.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:938:16
npm ERR!     at process._tickCallback (node.js:419:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     





to clean npm local repository, use "npm cache clean"




Wednesday, May 30, 2018

Eclipse for Docker

To install: Help/Eclipse Marketplace, search for Docker Tools, install.
Otherwise, install https://tools.jboss.org/features/dockertools.html "JBoss Tools" and you get also Docker Tools.

Show View / Docker Explorer

you get by default this one:

unix:///var/run/docker.sock

but you can also work with remote docker via TCP with authentication


this view shows ALL your containers (docker ps -a) and images (docker images), with a list of ports and volumes

https://www.eclipse.org/community/eclipse_newsletter/2015/june/article3.php


To enable managing a Docker environment running in your VirtualBox centos image, in VirtualBox enable port forwarding 2376 or 2375, see http://www.javamonamour.org/2017/12/docker-enabling-remote-daemon.html

Eclipse for Docker is a really nice tool! It makes it much easier to work with Docker. However I still believe one should be familiar with the Docker CLI.



Tuesday, May 29, 2018

Sanity check on a Nexus 2 Maven Proxy repo

The task is: verify that all the JARs in a Nexus 2 repo are still in Maven Central.

I did a
find /path/to/nexusdata/central -name "*.jar" > alljarsfiltered.txt


and then run this Java application:


package mavenchecker;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Stream;

public class MavenChecker {
 public static ArrayList<String> errors = new ArrayList<String>();
 public static ArrayList<String> nonexisting = new ArrayList<String>();
 static int count  = 0;

 public static void main(String[] args) {

  String fileName = "/home/centos/Downloads/alljarsfiltered.txt";
  
  // read file into stream, try-with-resources
  try (Stream<String> stream = Files.lines(Paths.get(fileName)).parallel()) {

   stream.forEach((line) -> checkLine(line));
   

  } catch (IOException e) {
   e.printStackTrace();
  }

  for (String error : errors) {
   System.out.println("ERROR : " + error);
  }

  for (String nonexistingItem : nonexisting) {
   System.out.println("nonexisting : " + nonexistingItem);
  }

 }

 private static void checkLine(String line) {
  count++;
  if (count % 100 == 0) {
   System.out.println("COUNT " + count);
  }
  if (!line.endsWith(".jar"))
   return;

  String gavstring = line.replace("/path/to/nexusdata/central/", "");
  String[] parts = gavstring.split("/");
  int len = parts.length;
  if (len < 4) {
   System.err.println("invalid length for gavstring " + gavstring + " len = " + len + " should be at least 4");
   errors.add(gavstring);
  } else {
   String filename = parts[len - 1];
   String version = parts[len - 2];
   String artifactid = parts[len - 3];
   String group = String.join(".", Arrays.copyOfRange(parts, 0, len - 3));
   String message = "filename=" + filename + " group=" + group + " artifactid=" + artifactid + " version=" + version;
   //System.out.println(message);
   boolean exists = exists("https://repo.maven.apache.org/maven2/" + gavstring);
   if (!exists) nonexisting.add(gavstring);
   
   
  }

 }
 
 public static boolean exists(String URLName){
     try {
       HttpURLConnection.setFollowRedirects(false);
       // note : you may also need
       //        HttpURLConnection.setInstanceFollowRedirects(false)
       HttpURLConnection con =
          (HttpURLConnection) new URL(URLName).openConnection();
       con.setRequestMethod("HEAD");
       return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
     }
     catch (Exception e) {
        e.printStackTrace();
        return false;
     }
   }

}




Monday, May 28, 2018

Nexus Firewall

http://www.javamonamour.org/2017/09/software-vulnerability-control-with.html

As usual, Sonatype scatters his product documentation across the 5 Oceans, in the most disparate formats (blogs, videos, poorly formatted wiki pages etc)


https://my.sonatype.com/firewall/


Good video here https://blog.sonatype.com/nexus-firewall-for-oss-users

https://help.sonatype.com/iqserver/nexus-firewall-quick-start
quick start

The Firewall product is really simple: given a GAV, it checks a DB (NIST Vulnerabilities) for all its vulnerabilities, and applies a bunch of rules to determine if the component is risky. If it's risky, it quarantines it, but provides a function to "unlock it" to the end user (Maven).


systemctl start service on boot with specific user

see https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units


sudo vi /etc/systemd/system/ms.service

[Unit]
Description=myservice

[Service]
User=myuser
ExecStart=/bin/bash /path/to/script/ms.sh start
ExecStop=/bin/bash /path/to/script/ms.sh stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target


sudo chmod 744 /etc/systemd/system/ms.service

sudo systemctl enable ms.service

(this should give you "Created symlink from /etc/systemd/system/multi-user.target.wants/ms.service to /etc/systemd/system/ms.service." )

How to troubleshoot? https://www.certdepot.net/systemd-service-debugging-tips/


systemctl start ms
systemctl status ms
journalctl -u ms


Saturday, May 26, 2018

Eclipse says server workload limit exceeded, please try later

I always enable error reporting in Eclipse, although I am pretty confident that in the House of Chaos that Eclipse must be, nobody is seriously looking at them - they are too many, there is no sign of any intelligence behind the product, etc.

Lately I am curiously getting ALWAYS this message "Eclipse says server workload limit exceeded, please try later"

Personally I consider it a good sign, it might mean that Eclipse is finally reaching a point of collapse, and that we shall be soon freed from his ominous presence, in favor of more decent product like IntelliJ or Netbeans.


Curiously, Eclipse rhymes with Collapse

Spring Boot 2 and Primefaces 6..... JoinFaces

http://joinfaces.org/ and https://github.com/joinfaces/joinfaces

Their started app is https://joinfaces-example.herokuapp.com/starter.jsf admin is persapiens/123)

git clone https://github.com/joinfaces/joinfaces-maven-jar-example.git
cd joinfaces-maven-jar-example
mvn clean install
(there are some test errors.... ignore them)

java -jar target/joinfaces-example-3.2.1-SNAPSHOT.jar

http://localhost:8080/starter.jsf


Unfortunately they use a parent pom....in Maven you can use only 1 parent pom (another reason to HATE MAVEN who is BROKEN BY DESIGN).... so if your application is already based on a parent pom, you are royally screwed.

Problem is, when I generate a project from Spring Boot Starters, the parent pom is:

<parent>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-parent</artifactId>
 <version>2.0.2.RELEASE</version>
 <relativePath/> <!-- lookup parent from repository -->
</parent>


while using joinfaces it's


<parent>
        <groupId>org.joinfaces</groupId>
        <artifactId>joinfaces-parent</artifactId>
        <version>3.2.1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>


you can clearly see from http://central.maven.org/maven2/org/joinfaces/joinfaces-parent/3.2.1/joinfaces-parent-3.2.1.pom that joinfaces includes all these dependencies http://central.maven.org/maven2/org/joinfaces/joinfaces-dependencies/3.2.1/joinfaces-dependencies-3.2.1.pom which entail also a parent:

<parent>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-parent</artifactId>
 <version>2.0.2.RELEASE</version>
 <relativePath/>
 <!-- lookup parent from repository -->
</parent>

No doubt, they have sorted out for you a massive dependency tree, saving a lot of time.

When I see such massive dependency tree, the question arises, why the Java world in 2018 is so ridiculously complicated and only getting worse. Please stop proliferation, focus on consolidation.











Friday, May 25, 2018

Nginx with LUA and Java handlers

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7

sudo yum install epel-release
sudo yum install nginx
sudo systemctl start nginx

nginx should now be running, enter http://localhost to test

documents in /usr/share/nginx/html

configuration in /etc/nginx/nginx.conf

logs in /var/log/nginx/access.log

sudo ausearch -c 'nginx' --raw | audit2allow -M my-nginx
sudo semodule -i my-nginx.pp
#disable selinux
setenforce 0



nginx with Docker https://hub.docker.com/_/nginx/
docker pull nginx
docker run --name nginx -d -p 10080:80 nginx
http://localhost:10080/



Setup a reverse proxy:
sudo vi /etc/nginx/conf.d/mynexus.conf

server{
    listen 18081;
    location / {
        proxy_pass "http://localhost:8081";
    }
}

systemctl stop nginx
systemctl start nginx

you can now point your maven mirror in settings.xml to point to 18081 and intercept all requests to Nexus

How to embed a Java handler in the loop ?
https://www.nginx.com/resources/wiki/modules/java_handler/
http://nginx-clojure.github.io/

Handlers in Java implement this interface NginxJavaRingHandler
https://github.com/nginx-clojure/nginx-clojure/blob/master/src/java/nginx/clojure/java/NginxJavaRingHandler.java





Ref: quick quide to configure yourdomain.com https://www.godaddy.com/garage/how-to-install-and-configure-nginx-on-centos-7/

nginx as reverse proxy https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/





Thursday, May 24, 2018

Testcontainers, using Docker containers in JUnit tests

Junit sucks, use at least 5.0 or better switch to TestNG (see http://www.baeldung.com/junit-vs-testng for comparison)


https://www.javacodegeeks.com/2018/05/testcontainers-and-spring-boot.html

https://github.com/bijukunjummen/cities

https://www.testcontainers.org/usage.html#maven-dependencies

https://github.com/testcontainers/testcontainers-java-examples

https://github.com/testcontainers/testcontainers-java


https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.testcontainers%22


To keep it really minimalistic, I have created a Maven Java project:

<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>org.pierre</groupId>
 <artifactId>testcontainer</artifactId>
 <version>1.0</version>
 <dependencies>
  <dependency>
   <groupId>org.testcontainers</groupId>
   <artifactId>testcontainers</artifactId>
   <version>1.7.3</version>
  </dependency>
  
  <dependency>
   <groupId>org.testcontainers</groupId>
   <artifactId>selenium</artifactId>
   <version>1.7.3</version>
  </dependency>
  
   
  
  <dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-remote-driver</artifactId>
   <version>2.45.0</version>
  </dependency>
  <dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-api</artifactId>
   <version>1.7.7</version>
   <scope>provided</scope>
  </dependency>
  <dependency>
   <groupId>ch.qos.logback</groupId>
   <artifactId>logback-classic</artifactId>
   <version>1.1.2</version>
   <scope>test</scope>
  </dependency>
 </dependencies>

 <properties>
  <maven.compiler.target>1.8</maven.compiler.target>
  <maven.compiler.source>1.8</maven.compiler.source>
 </properties>
</project>


and copied this example


package org.pierre.testcontainer;

import org.junit.Rule;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testcontainers.containers.BrowserWebDriverContainer;

import java.io.File;

import static org.rnorth.visibleassertions.VisibleAssertions.assertTrue;
import static org.testcontainers.containers.BrowserWebDriverContainer.VncRecordingMode.RECORD_ALL;


public class SeleniumContainerTest {

    @Rule
    public BrowserWebDriverContainer chrome = new BrowserWebDriverContainer()
                                                    .withDesiredCapabilities(DesiredCapabilities.chrome())
                                                    .withRecordingMode(RECORD_ALL, new File("target"));

    @Test
    public void simplePlainSeleniumTest() {
        RemoteWebDriver driver = chrome.getWebDriver();

        driver.get("https://wikipedia.org");
        WebElement searchInput = driver.findElementByName("search");

        searchInput.sendKeys("Rick Astley");
        searchInput.submit();

        WebElement otherPage = driver.findElementByLinkText("Rickrolling");
        otherPage.click();

        boolean expectedTextFound = driver.findElementsByCssSelector("p")
                .stream()
                .anyMatch(element -> element.getText().contains("meme"));

        assertTrue("The word 'meme' is found on a page about rickrolling", expectedTextFound);
}

}




The first time it failed with a SocketTimeoutException.... the second time it succeeded... I guess simply the Docker container was taking too much time to start.

If I do "docker images" I see richnorth/vnc-recorder and selenium/standalone-chrome-debug. If I do "docker ps -a" I see no trace of containers, probably they are removed at the end of test.


It looks really interesting! Convenient way to prepare a test environment in a fully automated way.






Wednesday, May 23, 2018

sudo systemctl hibernate

on Centos, I was trying to hibernate my machine:

sudo systemctl hibernate

A dependency job for hibernate.target failed. See 'journalctl -xe' for details.

journalctl -xe


Failed to write mode to /sys/power/disk: Operation not permitted

https://ask.fedoraproject.org/en/question/41118/f20-unable-to-hibernate-syspowerdisk-disabled/


I removed "safe boot" option in the BIOS settings, and now I am able to hibernate! Amazing!


See also this https://www.thegeekdiary.com/centos-rhel-7-shutting-down-suspending-or-rebooting-commands-systemctl/, maybe "suspend" is cheaper safer and faster than hibernate...



Scala, sbt and Nexus Repositories

https://github.com/travelaudience/kubernetes-nexus/blob/master/docs/usage/using-nexus-with-sbt.md



first, install sbt:

curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo
sudo mv bintray-sbt-rpm.repo /etc/yum.repos.d/
sudo yum install sbt
sbt --version


Then in Nexus create a Maven Proxy repository "ivy-releases" proxying http://repo.typesafe.com/typesafe/ivy-releases/, plus a repository "sbt-plugin-releases" proxying http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/ . Plus a group ivy with URL http://localhost:8181/repository/ivy/ and grouping ivy-releases + sbt-plugin-releases.


see https://www.scala-sbt.org/1.x/docs/Proxy-Repositories.html


vi ~/.sbt/repositories


[repositories]
local
my-ivy-proxy-releases: http://localhost:8181/repository/ivy/ , [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
my-maven-proxy-releases: http://localhost:8181/repository/maven-public/



https://github.com/jaceklaskowski/scalania


git clone https://github.com/jaceklaskowski/scalania.git
cd scalania
sbt -Dsbt.override.build.repos=true compile


rm -rf target
rm -rf /home/centos/.ivy2/cache



you should see that lot of stuff is pulled in your maven-central proxy repo and in your


Without Nexus you get this:


[centos@localhost scalania]$ sbt compile
[info] Loading project definition from /home/centos/gitclones/scalania/project
[info] Updating {file:/home/centos/gitclones/scalania/project/}scalania-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-compiler/2.10.4/scala-compiler-2.10.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.4!scala-compiler.jar (195ms)
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scoverage/sbt-coveralls/scala_2.10/sbt_0.13/1.0.0.BETA1/jars/sbt-coveralls.jar ...
[info]  [SUCCESSFUL ] org.scoverage#sbt-coveralls;1.0.0.BETA1!sbt-coveralls.jar (1957ms)
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/de.johoop/jacoco4sbt/scala_2.10/sbt_0.13/2.1.6/jars/jacoco4sbt.jar ...
[info]  [SUCCESSFUL ] de.johoop#jacoco4sbt;2.1.6!jacoco4sbt.jar (1811ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/2.5.0/jars/sbteclipse-plugin.jar ...
[info]  [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0!sbteclipse-plugin.jar (1791ms)
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-scalariform/scala_2.10/sbt_0.13/1.3.0/jars/sbt-scalariform.jar ...
[info]  [SUCCESSFUL ] com.typesafe.sbt#sbt-scalariform;1.3.0!sbt-scalariform.jar (2161ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalastyle/scalastyle-sbt-plugin_2.10_0.13/0.6.0/scalastyle-sbt-plugin-0.6.0.jar ...
[info]  [SUCCESSFUL ] org.scalastyle#scalastyle-sbt-plugin;0.6.0!scalastyle-sbt-plugin.jar (140ms)
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.sksamuel.scapegoat/sbt-scapegoat/scala_2.10/sbt_0.13/0.94.6/jars/sbt-scapegoat.jar ...
[info]  [SUCCESSFUL ] com.sksamuel.scapegoat#sbt-scapegoat;0.94.6!sbt-scapegoat.jar (3186ms)
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scoverage/sbt-scoverage/scala_2.10/sbt_0.13/1.0.4/jars/sbt-scoverage.jar ...
[info]  [SUCCESSFUL ] org.scoverage#sbt-scoverage;1.0.4!sbt-scoverage.jar (2122ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-library;2.10.4!scala-library.jar (201ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-reflect/2.10.4/scala-reflect-2.10.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.4!scala-reflect.jar (141ms)
[info] downloading http://localhost:8181/repository/maven-public/com/fasterxml/jackson/core/jackson-core/2.4.2/jackson-core-2.4.2.jar ...
[info]  [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-core;2.4.2!jackson-core.jar(bundle) (88ms)
[info] downloading http://localhost:8181/repository/maven-public/com/fasterxml/jackson/module/jackson-module-scala_2.10/2.4.2/jackson-module-scala_2.10-2.4.2.jar ...
[info]  [SUCCESSFUL ] com.fasterxml.jackson.module#jackson-module-scala_2.10;2.4.2!jackson-module-scala_2.10.jar(bundle) (235ms)
[info] downloading http://localhost:8181/repository/maven-public/org/eclipse/jgit/org.eclipse.jgit/3.4.1.201406201815-r/org.eclipse.jgit-3.4.1.201406201815-r.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jgit#org.eclipse.jgit;3.4.1.201406201815-r!org.eclipse.jgit.jar (112ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaj/scalaj-http_2.10/0.3.16/scalaj-http_2.10-0.3.16.jar ...
[info]  [SUCCESSFUL ] org.scalaj#scalaj-http_2.10;0.3.16!scalaj-http_2.10.jar (126ms)
[info] downloading http://localhost:8181/repository/maven-public/com/fasterxml/jackson/core/jackson-annotations/2.4.2/jackson-annotations-2.4.2.jar ...
[info]  [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-annotations;2.4.2!jackson-annotations.jar(bundle) (97ms)
[info] downloading http://localhost:8181/repository/maven-public/com/fasterxml/jackson/core/jackson-databind/2.4.2/jackson-databind-2.4.2.jar ...
[info]  [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-databind;2.4.2!jackson-databind.jar(bundle) (92ms)
[info] downloading http://localhost:8181/repository/maven-public/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ...
[info]  [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (110ms)
[info] downloading http://localhost:8181/repository/maven-public/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar ...
[info]  [SUCCESSFUL ] com.google.code.findbugs#jsr305;2.0.1!jsr305.jar (99ms)
[info] downloading http://localhost:8181/repository/maven-public/com/google/guava/guava/15.0/guava-15.0.jar ...
[info]  [SUCCESSFUL ] com.google.guava#guava;15.0!guava.jar(bundle) (100ms)
[info] downloading http://localhost:8181/repository/maven-public/com/jcraft/jsch/0.1.50/jsch-0.1.50.jar ...
[info]  [SUCCESSFUL ] com.jcraft#jsch;0.1.50!jsch.jar (111ms)
[info] downloading http://localhost:8181/repository/maven-public/com/googlecode/javaewah/JavaEWAH/0.7.9/JavaEWAH-0.7.9.jar ...
[info]  [SUCCESSFUL ] com.googlecode.javaewah#JavaEWAH;0.7.9!JavaEWAH.jar(bundle) (76ms)
[info] downloading http://localhost:8181/repository/maven-public/org/apache/httpcomponents/httpclient/4.1.3/httpclient-4.1.3.jar ...
[info]  [SUCCESSFUL ] org.apache.httpcomponents#httpclient;4.1.3!httpclient.jar (144ms)
[info] downloading http://localhost:8181/repository/maven-public/org/apache/httpcomponents/httpcore/4.1.4/httpcore-4.1.4.jar ...
[info]  [SUCCESSFUL ] org.apache.httpcomponents#httpcore;4.1.4!httpcore.jar (55ms)
[info] downloading http://localhost:8181/repository/maven-public/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar ...
[info]  [SUCCESSFUL ] commons-logging#commons-logging;1.1.1!commons-logging.jar (97ms)
[info] downloading http://localhost:8181/repository/maven-public/commons-codec/commons-codec/1.4/commons-codec-1.4.jar ...
[info]  [SUCCESSFUL ] commons-codec#commons-codec;1.4!commons-codec.jar (121ms)
[info] downloading http://localhost:8181/repository/maven-public/org/jacoco/org.jacoco.core/0.7.1.201405082137/org.jacoco.core-0.7.1.201405082137.jar ...
[info]  [SUCCESSFUL ] org.jacoco#org.jacoco.core;0.7.1.201405082137!org.jacoco.core.jar (89ms)
[info] downloading http://localhost:8181/repository/maven-public/org/jacoco/org.jacoco.report/0.7.1.201405082137/org.jacoco.report-0.7.1.201405082137.jar ...
[info]  [SUCCESSFUL ] org.jacoco#org.jacoco.report;0.7.1.201405082137!org.jacoco.report.jar (148ms)
[info] downloading http://localhost:8181/repository/maven-public/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.jar ...
[info]  [SUCCESSFUL ] org.ow2.asm#asm-debug-all;5.0.1!asm-debug-all.jar (120ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-core/scala_2.10/sbt_0.13/2.5.0/jars/sbteclipse-core.jar ...
[info]  [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-core;2.5.0!sbteclipse-core.jar (3240ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaz/scalaz-core_2.10/7.0.2/scalaz-core_2.10-7.0.2.jar ...
[info]  [SUCCESSFUL ] org.scalaz#scalaz-core_2.10;7.0.2!scalaz-core_2.10.jar(bundle) (167ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaz/scalaz-effect_2.10/7.0.2/scalaz-effect_2.10-7.0.2.jar ...
[info]  [SUCCESSFUL ] org.scalaz#scalaz-effect_2.10;7.0.2!scalaz-effect_2.10.jar(bundle) (81ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalariform/scalariform_2.10/0.1.4/scalariform_2.10-0.1.4.jar ...
[info]  [SUCCESSFUL ] org.scalariform#scalariform_2.10;0.1.4!scalariform_2.10.jar (135ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalastyle/scalastyle_2.10/0.6.0/scalastyle_2.10-0.6.0.jar ...
[info]  [SUCCESSFUL ] org.scalastyle#scalastyle_2.10;0.6.0!scalastyle_2.10.jar (108ms)
[info] downloading http://localhost:8181/repository/maven-public/com/danieltrinh/scalariform_2.10/0.1.5/scalariform_2.10-0.1.5.jar ...
[info]  [SUCCESSFUL ] com.danieltrinh#scalariform_2.10;0.1.5!scalariform_2.10.jar (100ms)
[info] downloading http://localhost:8181/repository/maven-public/com/typesafe/config/1.2.0/config-1.2.0.jar ...
[info]  [SUCCESSFUL ] com.typesafe#config;1.2.0!config.jar(bundle) (144ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scoverage/scalac-scoverage-plugin_2.10/1.0.4/scalac-scoverage-plugin_2.10-1.0.4.jar ...
[info]  [SUCCESSFUL ] org.scoverage#scalac-scoverage-plugin_2.10;1.0.4!scalac-scoverage-plugin_2.10.jar (110ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/jars/sbt.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#sbt;0.13.8!sbt.jar (1693ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.8/jars/main.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#main;0.13.8!main.jar (2573ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.8/jars/compiler-interface-bin.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.8!compiler-interface-bin.jar (1803ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.8/jars/compiler-interface-src.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.8!compiler-interface-src.jar (2961ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_8_2/0.13.8/jars/compiler-interface-bin.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#precompiled-2_8_2;0.13.8!compiler-interface-bin.jar (2133ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_2/0.13.8/jars/compiler-interface-bin.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_2;0.13.8!compiler-interface-bin.jar (1859ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_3/0.13.8/jars/compiler-interface-bin.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_3;0.13.8!compiler-interface-bin.jar (1849ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.8/jars/actions.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#actions;0.13.8!actions.jar (2064ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.8/jars/main-settings.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#main-settings;0.13.8!main-settings.jar (1987ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.13.8/jars/interface.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#interface;0.13.8!interface.jar (1858ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.8/jars/io.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#io;0.13.8!io.jar (1987ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.8/jars/ivy.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#ivy;0.13.8!ivy.jar (2481ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/launcher-interface/0.13.8/jars/launcher-interface.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#launcher-interface;0.13.8!launcher-interface.jar (1701ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logging/0.13.8/jars/logging.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#logging;0.13.8!logging.jar (1799ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logic/0.13.8/jars/logic.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#logic;0.13.8!logic.jar (1736ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/process/0.13.8/jars/process.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#process;0.13.8!process.jar (1919ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/run/0.13.8/jars/run.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#run;0.13.8!run.jar (1817ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.8/jars/command.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#command;0.13.8!command.jar (1886ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classpath/0.13.8/jars/classpath.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#classpath;0.13.8!classpath.jar (12828ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.8/jars/completion.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#completion;0.13.8!completion.jar (1870ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.8/jars/api.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#api;0.13.8!api.jar (1822ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.8/jars/compiler-integration.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#compiler-integration;0.13.8!compiler-integration.jar (1900ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-ivy-integration/0.13.8/jars/compiler-ivy-integration.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#compiler-ivy-integration;0.13.8!compiler-ivy-integration.jar (1688ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/relation/0.13.8/jars/relation.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#relation;0.13.8!relation.jar (1826ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/task-system/0.13.8/jars/task-system.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#task-system;0.13.8!task-system.jar (1798ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tasks/0.13.8/jars/tasks.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#tasks;0.13.8!tasks.jar (1844ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tracking/0.13.8/jars/tracking.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#tracking;0.13.8!tracking.jar (1718ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/testing/0.13.8/jars/testing.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#testing;0.13.8!testing.jar (1865ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/control/0.13.8/jars/control.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#control;0.13.8!control.jar (1842ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.8/jars/collections.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#collections;0.13.8!collections.jar (2043ms)
[info] downloading http://localhost:8181/repository/maven-public/jline/jline/2.11/jline-2.11.jar ...
[info]  [SUCCESSFUL ] jline#jline;2.11!jline.jar (133ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.8/jars/incremental-compiler.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#incremental-compiler;0.13.8!incremental-compiler.jar (1877ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.8/jars/compile.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#compile;0.13.8!compile.jar (1773ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/persist/0.13.8/jars/persist.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#persist;0.13.8!persist.jar (1813ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classfile/0.13.8/jars/classfile.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#classfile;0.13.8!classfile.jar (1755ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbinary/sbinary_2.10/0.4.2/jars/sbinary_2.10.jar ...
[info]  [SUCCESSFUL ] org.scala-tools.sbinary#sbinary_2.10;0.4.2!sbinary_2.10.jar (2288ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cross/0.13.8/jars/cross.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#cross;0.13.8!cross.jar (2532ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt.ivy/ivy/2.3.0-sbt-fccfbd44c9f64523b61398a0155784dcbaeae28f/jars/ivy.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-fccfbd44c9f64523b61398a0155784dcbaeae28f!ivy.jar (2079ms)
[info] downloading http://localhost:8181/repository/maven-public/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar ...
[info]  [SUCCESSFUL ] com.jcraft#jsch;0.1.46!jsch.jar (134ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/serialization_2.10/0.1.1/jars/serialization_2.10.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#serialization_2.10;0.1.1!serialization_2.10.jar (1903ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-pickling_2.10/0.10.0/scala-pickling_2.10-0.10.0.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-pickling_2.10;0.10.0!scala-pickling_2.10.jar (102ms)
[info] downloading http://localhost:8181/repository/maven-public/org/json4s/json4s-core_2.10/3.2.10/json4s-core_2.10-3.2.10.jar ...
[info]  [SUCCESSFUL ] org.json4s#json4s-core_2.10;3.2.10!json4s-core_2.10.jar (106ms)
[info] downloading http://localhost:8181/repository/maven-public/org/spire-math/jawn-parser_2.10/0.6.0/jawn-parser_2.10-0.6.0.jar ...
[info]  [SUCCESSFUL ] org.spire-math#jawn-parser_2.10;0.6.0!jawn-parser_2.10.jar (119ms)
[info] downloading http://localhost:8181/repository/maven-public/org/spire-math/json4s-support_2.10/0.6.0/json4s-support_2.10-0.6.0.jar ...
[info]  [SUCCESSFUL ] org.spire-math#json4s-support_2.10;0.6.0!json4s-support_2.10.jar (139ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalamacros/quasiquotes_2.10/2.0.1/quasiquotes_2.10-2.0.1.jar ...
[info]  [SUCCESSFUL ] org.scalamacros#quasiquotes_2.10;2.0.1!quasiquotes_2.10.jar (131ms)
[info] downloading http://localhost:8181/repository/maven-public/org/json4s/json4s-ast_2.10/3.2.10/json4s-ast_2.10-3.2.10.jar ...
[info]  [SUCCESSFUL ] org.json4s#json4s-ast_2.10;3.2.10!json4s-ast_2.10.jar (85ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cache/0.13.8/jars/cache.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#cache;0.13.8!cache.jar (1939ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/test-agent/0.13.8/jars/test-agent.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.8!test-agent.jar (1748ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#test-interface;1.0!test-interface.jar (153ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.13.8/jars/apply-macro.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.8!apply-macro.jar (1845ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/jline/2.10.4/jline-2.10.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#jline;2.10.4!jline.jar (100ms)
[info] downloading http://localhost:8181/repository/maven-public/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
[info]  [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (125ms)
[info] Done updating.
[info] Compiling 2 Scala sources to /home/centos/gitclones/scalania/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to scalania (in build file:/home/centos/gitclones/scalania/)
[info] Updating {file:/home/centos/gitclones/scalania/}scalania...
[info] Updating {file:/home/centos/gitclones/scalania/}exercises...
[info] Resolving org.scala-lang#scala-library;2.11.6 ...
[info] Formatting 45 Scala sources {file:/home/centos/gitclones/scalania/}exercises(compile) ...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-library;2.11.6!scala-library.jar (146ms)
[info] downloading http://localhost:8181/repository/maven-public/com/sksamuel/scapegoat/scalac-scapegoat-plugin_2.11/0.94.6/scalac-scapegoat-plugin_2.11-0.94.6.jar ...
[info]  [SUCCESSFUL ] com.sksamuel.scapegoat#scalac-scapegoat-plugin_2.11;0.94.6!scalac-scapegoat-plugin_2.11.jar (217ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-library;2.11.4!scala-library.jar (151ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-reflect/2.11.4/scala-reflect-2.11.4.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.4!scala-reflect.jar (116ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.2!scala-xml_2.11.jar(bundle) (127ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scaldi/scaldi_2.11/0.4/scaldi_2.11-0.4.jar ...
[info]  [SUCCESSFUL ] org.scaldi#scaldi_2.11;0.4!scaldi_2.11.jar (103ms)
[info] downloading http://localhost:8181/repository/maven-public/org/specs2/specs2-core_2.11/2.4.5/specs2-core_2.11-2.4.5.jar ...
[info]  [SUCCESSFUL ] org.specs2#specs2-core_2.11;2.4.5!specs2-core_2.11.jar (239ms)
[info] downloading http://localhost:8181/repository/maven-public/org/specs2/specs2-junit_2.11/2.4.5/specs2-junit_2.11-2.4.5.jar ...
[info]  [SUCCESSFUL ] org.specs2#specs2-junit_2.11;2.4.5!specs2-junit_2.11.jar (129ms)
[info] downloading http://localhost:8181/repository/maven-public/org/specs2/specs2-scalacheck_2.11/2.4.5/specs2-scalacheck_2.11-2.4.5.jar ...
[info]  [SUCCESSFUL ] org.specs2#specs2-scalacheck_2.11;2.4.5!specs2-scalacheck_2.11.jar (214ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalatest/scalatest_2.11/2.2.4/scalatest_2.11-2.2.4.jar ...
[info]  [SUCCESSFUL ] org.scalatest#scalatest_2.11;2.2.4!scalatest_2.11.jar(bundle) (203ms)
[info] downloading http://localhost:8181/repository/maven-public/org/specs2/specs2-matcher_2.11/2.4.5/specs2-matcher_2.11-2.4.5.jar ...
[info]  [SUCCESSFUL ] org.specs2#specs2-matcher_2.11;2.4.5!specs2-matcher_2.11.jar (225ms)
[info] downloading http://localhost:8181/repository/maven-public/org/specs2/specs2-common_2.11/2.4.5/specs2-common_2.11-2.4.5.jar ...
[info]  [SUCCESSFUL ] org.specs2#specs2-common_2.11;2.4.5!specs2-common_2.11.jar (131ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaz/scalaz-core_2.11/7.1.0/scalaz-core_2.11-7.1.0.jar ...
[info]  [SUCCESSFUL ] org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle) (133ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaz/scalaz-concurrent_2.11/7.1.0/scalaz-concurrent_2.11-7.1.0.jar ...
[info]  [SUCCESSFUL ] org.scalaz#scalaz-concurrent_2.11;7.1.0!scalaz-concurrent_2.11.jar(bundle) (68ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.2!scala-parser-combinators_2.11.jar(bundle) (101ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalaz/scalaz-effect_2.11/7.1.0/scalaz-effect_2.11-7.1.0.jar ...
[info]  [SUCCESSFUL ] org.scalaz#scalaz-effect_2.11;7.1.0!scalaz-effect_2.11.jar(bundle) (371ms)
[info] downloading http://localhost:8181/repository/maven-public/junit/junit/4.11/junit-4.11.jar ...
[info]  [SUCCESSFUL ] junit#junit;4.11!junit.jar (100ms)
[info] downloading http://localhost:8181/repository/maven-public/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar ...
[info]  [SUCCESSFUL ] org.hamcrest#hamcrest-core;1.3!hamcrest-core.jar (136ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scalacheck/scalacheck_2.11/1.11.3/scalacheck_2.11-1.11.3.jar ...
[info]  [SUCCESSFUL ] org.scalacheck#scalacheck_2.11;1.11.3!scalacheck_2.11.jar (100ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scoverage/scalac-scoverage-runtime_2.11/1.0.4/scalac-scoverage-runtime_2.11-1.0.4.jar ...
[info]  [SUCCESSFUL ] org.scoverage#scalac-scoverage-runtime_2.11;1.0.4!scalac-scoverage-runtime_2.11.jar (98ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scoverage/scalac-scoverage-plugin_2.11/1.0.4/scalac-scoverage-plugin_2.11-1.0.4.jar ...
[info]  [SUCCESSFUL ] org.scoverage#scalac-scoverage-plugin_2.11;1.0.4!scalac-scoverage-plugin_2.11.jar (132ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-xml_2.11/1.0.1/scala-xml_2.11-1.0.1.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.1!scala-xml_2.11.jar(bundle) (102ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-compiler/2.11.6/scala-compiler-2.11.6.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.6!scala-compiler.jar (206ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/scala-reflect/2.11.6/scala-reflect-2.11.6.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.6!scala-reflect.jar (72ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-xml_2.11/1.0.3/scala-xml_2.11-1.0.3.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.3!scala-xml_2.11.jar(bundle) (102ms)
[info] downloading http://localhost:8181/repository/maven-public/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.3/scala-parser-combinators_2.11-1.0.3.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.3!scala-parser-combinators_2.11.jar(bundle) (115ms)
[info] downloading http://localhost:8181/repository/maven-public/jline/jline/2.12.1/jline-2.12.1.jar ...
[info]  [SUCCESSFUL ] jline#jline;2.12.1!jline.jar (81ms)
[info] Done updating.
[info] Resolving org.scala-lang#scala-reflect;2.11.4 ...
[info] [scapegoat] setting output dir to [/home/centos/gitclones/scalania/target/scala-2.11/scapegoat-report]
[info] Resolving org.jacoco#org.jacoco.build;0.7.1.201405082137 ...
[info] downloading http://localhost:8181/repository/maven-public/org/jacoco/org.jacoco.agent/0.7.1.201405082137/org.jacoco.agent-0.7.1.201405082137.jar ...
[info]  [SUCCESSFUL ] org.jacoco#org.jacoco.agent;0.7.1.201405082137!org.jacoco.agent.jar (64ms)
[info] Done updating.
[info] [scapegoat] setting output dir to [/home/centos/gitclones/scalania/exercises/target/scala-2.11/scapegoat-report]
[info] [scapegoat] disabled inspections: X
[info] [scapegoat] enabled inspections: ArraysToString
[info] [scapegoat] ignored file patterns: X
[info] Compiling 45 Scala sources to /home/centos/gitclones/scalania/exercises/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.6. Compiling...
[info]   Compilation completed in 9.394 s




but with Nexus proxy I still get some unresolved dependencies

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scoverage#sbt-coveralls;1.0.0.BETA1: not found
[warn]  :: de.johoop#jacoco4sbt;2.1.6: not found
[warn]  :: com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0: not found
[warn]  :: com.typesafe.sbt#sbt-scalariform;1.3.0: not found
[warn]  :: com.sksamuel.scapegoat#sbt-scapegoat;0.94.6: not found
[warn]  :: org.scoverage#sbt-scoverage;1.0.4: not found
[warn]  :: org.scala-sbt#sbt;0.13.8: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::




no clue what is wrong....


On the other hand, if I follow this foo-build example https://www.scala-sbt.org/1.x/docs/sbt-by-example.html

mkdir foo-build
cd foo-build
touch build.sbt
sbt -Dsbt.override.build.repos=true compile


all works fine!