What are the key differences between Scala and Groovy? – Stack Overflow

They’re both object oriented languages for the JVM that have lambdas and closures and interoperate with Java. Other than that, they’re extremely different.Groovy is a “dynamic” language in not only the sense that it is dynamically typed but that it supports dynamic meta-programming.Scala is a “static” language in that it is statically typed and has virtually no dynamic meta-programming beyond the awkward stuff you can do in Java. Note, Scala’s static type system is substantially more uniform and sophisticated than Java’s.Groovy is syntactically influenced by Java but semantically influenced more by languages like Ruby.Scala is syntactically influenced by both Ruby and Java. It is semantically influenced more by Java, SML, Haskell, and a very obscure OO language called gBeta.Groovy has “accidental” multiple dispatch due to the way it handles Java overloading.Scala is single dispatch only, but has SML inspired pattern matching to deal with some of the same kinds of problems that multiple dispatch is meant to handle. However, where multiple dispatch can only dispatch on runtime type, Scala’s pattern matching can dispatch on runtime types, values, or both. Pattern matching also includes syntactically pleasant variable binding. It’s hard to overstress how pleasant this single feature alone makes programming in Scala.Both Scala and Groovy support a form of multiple inheritance with mixins (though Scala calls them traits).Scala supports both partial function application and currying at the language level, Groovy has an awkward “curry” method for doing partial function application.Scala does direct tail recursion optimization. I don’t believe Groovy does. That’s important in functional programming but less important in imperative programming.Both Scala and Groovy are eagerly evaluated by default. However, Scala supports call-by-name parameters. Groovy does not – call-by-name must be emulated with closures.Scala has “for comprehensions”, a generalization of list comprehensions found in other languages (technically they’re monad comprehensions plus a bit – somewhere between Haskell’s do and C#’s LINQ).Scala has no concept of “static” fields, inner classes, methods, etc – it uses singleton objects instead. Groovy uses the static concept.Scala does not have built in selection of arithmetic operators in quite the way that Groovy does. In Scala you can name methods very flexibly.Groovy has the elvis operator for dealing with null. Scala programmers prefer to use Option types to using null, but it’s easy to write an elvis operator in Scala if you want to.Finally, there are lies, there are damn lies, and then there are benchmarks. The computer language benchmarks game ranks Scala as being between substantially faster than Groovy (ranging from twice to 93 times as fast) while retaining roughly the same source size. benchmarks.I’m sure there are many, many differences that I haven’t covered. But hopefully this gives you a gist.Is there a competition between them? Yes, of course, but not as much as you might think. Groovy’s real competition is JRuby and Jython.Who’s going to win? My crystal ball is as cracked as anybody else’s.

Source: What are the key differences between Scala and Groovy? – Stack Overflow

java – Download WAR from snapshot-repository and deploy to local JBoss using mvn – Stack Overflow

Ideally you would want to set up Jenkins to deploy to your testing server as part of your CI build.

Alternatively, if you want to manually run a script on the server you are deploying to, you could set up a specific pom.xml to perform this task. First setup the dependency plugin to download your war:

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-dependency-plugin</artifactId>

<version>2.3</version>

<executions>

<execution>

<phase>package</phase>

<goals>

<goal>copy</goal>

</goals>

<configuration>

<artifactItems>

<artifactItem>

<groupId>my-group</groupId>

<artifactId>my-web-archive</artifactId>

<version>my-vesion</version>

<type>war</type>

<destFileName>my-web-archive.war</destFileName>

</artifactItem>

</artifactItems>

<outputDirectory>${project.build.directory}</outputDirectory>

</configuration>

</execution>

</executions>

</plugin>

Substituting the group ID, artifact ID and version for the respective properties of your WAR file. Next configure the JBoss plugin to deploy the downloaded WAR:

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>jboss-maven-plugin</artifactId>

<version>1.5.0</version>

<configuration>

<jbossHome>/opt/jboss-6</jbossHome>

<serverName>all</serverName>

<fileName>${project.build.directory}/my-web-archive.war</fileName>

</configuration>

</plugin>

You should then be able to download the artifact from your internal repository and deploy it in the locally running JBoss container with the following command:

mvn package jboss:hard-deploy

via java – Download WAR from snapshot-repository and deploy to local JBoss using mvn – Stack Overflow.

linux – Bash: Display each sub-directory size in a list format using 1 line command? – Super User

du -h –max-depth=1

Output

oliver@home:/usr$ sudo du -h --max-depth=1
24M ./include
20M ./sbin
228M ./local
4.0K ./src
520M ./lib
8.0K ./games
1.3G ./share
255M ./bin
2.4G .

Alternative

If –max-depth=1 is a bit too long for your taste, you can also try using:

du -h -s *

This uses -s (–summarize) and will only print the size of the folder itself by default. By passing all elements in the current working directory (*), it produces similar output as –max-depth=1 would:

Output

oliver@cloud:/usr$ sudo du -h -s *
255M bin
8.0K games
24M include
520M lib
0 lib64
228M local
20M sbin
1.3G share
4.0K src

The difference is subtle. The former approach will display the total size of the current working directory and the total size of all folders that are contained in it… but only up to a depth of 1.

The latter approach will calculate the total size of all passed items individually. Thus, it includes the symlink lib64 in the output, but excludes the hidden items (whose name start with a dot). It also lacks the total size for the current working directory, as that was not passed as an argument.

via linux – Bash: Display each sub-directory size in a list format using 1 line command? – Super User.