Pagine

Tuesday 4 July 2017

maven-assembly-plugin error: No formats specified in the execution parameters or the assembly descriptor

Build Error log:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:55 min
[INFO] Finished at: 2017-07-03T09:37:42+02:00
[INFO] Final Memory: 186M/444M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (default) on project mycomponent: No formats specified in the execution parameters or the assembly descriptor. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :mycomponent
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:39 min
[INFO] Finished at: 2017-07-03T09:37:43+02:00
[INFO] Final Memory: 17M/90M
[INFO] ------------------------------------------------------------------------

Solution:

The maven-assembly-plugin version 2.4.1 is affect of a bug. I found the following apache issue jira in https://issues.apache.org/jira/browse/FALCON-1898. This is issue regards the version 2.6 but I think the same bug. You can use an other plugin version, I used the version 2.2 to fix it. 

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2</version>
    <executions>
       .....
    </executions>
</plugin>   

Monday 3 July 2017

Maven compilation error - java.lang.IllegalStateException: endPosTable already set

Error stack trace:

java.lang.IllegalStateException: endPosTable already set
        at com.sun.tools.javac.util.DiagnosticSource.setEndPosTable(DiagnosticSource.java:136)
        at com.sun.tools.javac.util.Log.setEndPosTable(Log.java:350)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:667)
        at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:892)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:921)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1187)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:823)
        at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:153)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] An unknown compilation problem occurred
    [INFO] 1 error
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:

Solution:

A better solution is the usage of useIncrementalCompilation option in compiler plugin configuration as below:
    <plugin>         <groupId>org.apache.maven.plugins</groupId>         <artifactId>maven-compiler-plugin</artifactId>         <version>${maven-compiler-plugin.version}</version>         <configuration>           <compilerVersion>1.8</compilerVersion>           <source>1.8</source>           <target>1.8</target>           <useIncrementalCompilation>false</useIncrementalCompilation>           <compilerArgs>             <arg>-Xlint:deprecation</arg>             <arg>-Xlint:unchecked</arg>           </compilerArgs>         </configuration>     </plugin>

Technology stack:

  • Apache Maven 3.3.9
  • Jdk 1.8.0_73

Friday 30 June 2017

Comparison of Subversion clients

There are several subversion clients as TortoiseSVN, SmartSVN, RabbitVCS, VisualSVN, AnkhSVN, etc... Choose the better svn client is not easy because it depends from the usage you want to do and the other softwares related.
The goal of this short article is to make a brief overview of some of the clients in circulation highlighting the relevant terms for each of them. 

TortoiseSVN

TortoiseSVN implements a Windows shell extension (linux version is not available), it is easy to use, since it doesn't require the Subversion command line client to run. About the license It is a free tool (GPL).
TortoiseSVN's official web page: https://tortoisesvn.net/

SmartSVN

SmartSVN is a client avaible for OS X, Linux and Windows. It provides a good user interface. About the license, there are two versions: free Foundation edition and as full-featured Professional edition. 
SmartSVN's official web page: http://www.smartsvn.com/

RabbitVCS

RabbitVCS is a set of graphical tools for linux written to provide simple and straightforward access to the version control systems you use. It is not only svn client but even for others source version controls, for example Git. About the licence, it is an other free tool (GPL). You can see some screenshoot in this page.
RabbitVCS's official web page: http://rabbitvcs.org/

VisualSVN

VisualSVN is a professional grade svn integration plug-in for Visual Studio. I think that this plug-in is mandatory if you use svn and Visual Studio.  About the licence, there are more versions also free versions, all details are described in this page. You can see some screenshoot in this page.
VisualSVN's official web page: https://www.visualsvn.com/visualsvn/

AnkhSVN

AnkhSVN is an other Subversion Source Control Provider for Microsoft Visual Studio 2005-2015 and 2017.  About the licence, it is an other free tool but with Apache Licence. You can see some screenshoot in this page.
AnkhSVN's official web page: https://ankhsvn.open.collab.net/

Thursday 29 June 2017

Eclipse SVN Subclipse vs Subversive plugin

The SVN people have developed a plugin called Subclipse. The Eclipse people have a plugin called Subversive.
Subclipse includes the CollabNet Merge Client originally developed as part of the CollabNet Desktop - Eclipse Edition. The CollabNet Merge Client provides powerful graphical merge capabilities that leverages the merge tracking functionality that was added as part of the Subversion 1.5 release.
Subclipse includes an optional Mylyn connector that enables Mylyn to create automatic changesets based on the tasks you are working on. It also enables links to tasks when viewing history of Subversion commits.
You can see the Subclipse's screenshots in this page.

Instead Subversive have a few convenient features as:

  • Full-Scale SVN Client
  • Seamless Integration with Eclipse
  • Advanced SVN Features
  • Support of the Latest SVN Versions
You can see the Subversive's screenshots in this page.

Functionally the products are very similar as both are mature products.

Monday 26 June 2017

Cloud service models – IaaS, PaaS, and SaaS

There are three cloud-based service models, IaaS, PaaS, and SaaS. The main features of each of these are listed here:
  • Infrastructure as a Service (IaaS) provides users the capability to provision processing, storage, and network resources on demand. The customers deploy and run their own applications on these resources. Using this service model is closest to the traditional in-premise models and the virtual server provisioning models (typically offered by data center outsourcers). The onus
    of administering these resources rests largely with the customer.
  • In Platform as a Service(PaaS), the service provider makes certain core components, such as databases, queues, workflow engines, e-mails, and so on, which are available as services to the customer. The customer then leverages these components for building their own applications. The service provider ensures high service levels, and is responsible for scalability, highavailability, and so on for these components. This allows customers to focus a lot more on their application's functionality. However, this model also leads to application-level dependency on the providers' services.
  • In the Software as a Service(SaaS) model, typically, third-party providers using a subscription model provide end-user applications to their customers. The customers might have some administrative capability at the application level, for example, to create and manage their users. Such applications also provide some degree of customizability, for example, the customers can use their own corporate logos, colors, and many more. Applications that have a very wide user base most often operate in a self-service mode. In contrast, the provider provisions the application for the customer for more specialized applications. The provider also hands over certain application administrative tasks to the customer's application administrator (in most cases, this is limited to creating new users, managing passwords, and so on through well-defined application interfaces).
From an infrastructure perspective, the customer does not manage or control the underlying cloud infrastructure in all three service models.
The diagram illustrates who is responsible for managing the various components of a typical user application across IaaS, PaaS, and SaaS cloud service models. The column labeled Private represents the main components of a user application stack, while the following columns depict the varying levels of management responsibilities in each of the three service models. The shaded boxes are managed by the service provider, while the unshaded boxes are managed by the user.
The level of control over operating systems, storage, applications, and certain network components (for example, load balancers) is the highest in the IaaS model, while the least (or none) in the SaaS model.

Friday 23 June 2017

What is cloud computing?

Wikipedia defines cloud computing as:
 "Cloud computing is internet-based computing in which large groups of remote servers are networked to allow the centralized data storage, and online access to computer services or resources."
The National Institute of Standards and Technology (NIST) gives the following definition of cloud computing:
"Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction."
 
There are several other broadly accepted definitions of cloud computing. Some explicitly emphasize configurability of the resources, while others include the need for rapid on-demand provisioning of resources, and still others drop the requirement of access via the internet. We define cloud computing as a model that enables the features listed here:
  • Users should be able to provision and release resources on-demand;
  • The resources can be scaled up or down automatically, depending on the load;
  • The provisioned resources should be accessible over a network;
  • Cloud service providers should enable a pay-as-you-go model, where customers are charged based on the type and quantum of  resources they consume.
Some of the implications of choosing to use the cloud for your computing needs are as follows:
  • The illusion of infinite processing and storage resources, available on-demand, reduces the need for detailed advance planning and procurement processes. 
  • The model promotes the use of resources as per customer needs, for example, starting small, and then increasing resources based on an increase in need. 
  • The development and test environments can be provisioned on a smaller scale than production environment, and enabled only during normal business hours, to reduce costs.
  • The staging environment can be provisioned for a short duration to be a replica of the production environment. This enables testing using production configuration (and scale) for improved defect resolution.
  • There will be ease of scaling, both vertically and horizontally, in order to better manage spikes in demand and variations due to business cycles or time-of-day reasons, and so on.
  • This encourages experimentation, by trying out new ideas and software by quickly  provisioning resources, rather than requisition for resources through time-consuming and cumbersome processes.
In addition, there are several key operational and maintenance-related implications, including no hardware maintenance or data center operations required, zero-downtime migrations and upgrades, ease of replacement of unhealthy machines, ease of implementation of high-availability and disaster recovery strategies, and many more.

Thursday 22 June 2017

What is GitHub?

GitHub is the leading code-hosting platform with literally millions of open source projects having their code hosted on it. In conjunction with Git, it provides the means for a productive development workflow and is the preferred tool among developers.

Starting with the basics of creating a repository, you can learn how to manage the issue tracker, where your project can be discussed.
GitHub provides a set of features as of example:
  • Managing wiki pages: When you first create a new repository, a wiki attached to this project is also created. It is enabled by default and everyone can add new content or modify existing pages. Every time you add one or more new pages to the wiki. Similarly you can edit or remove a wiki page.
  • Managing code versioning: the notion of a release is tightly tied to Git tags. You can see the existing tags, if any, from the same menu where you change a branch. Your tag name can be any arbitrary value, but it is highly recommended to follow the semantic versioning scheme. Briefly describing what semantic versioning is, a release number consists of three numbers separated by dots in the form of MAJOR.MINOR.PATCH. You should then increment the following:
    • The MAJOR version when you make incompatible API changes.
    • The MINOR version when you add functionality in a backwards-compatible manner.
    • The PATCH version when you make backwards-compatible bug fixes.
  • Organization and team management: GitHub allows you to choose among three roles for a person in an organization: owners, members, and billing managers. Owners have full access to the organization and are in the highest level of the permissions chain. Being a member is usually the default role when a new person gets in the organization. The least a member can do is create a new team and add existing team members and repositories to it. A billing manager is a user who manages the billing settings for your organization, such as updating payment information. This is a great option if regular members of your organization don't typically have access to billing resources. You can create an Organization and you can optionally invite some people to be part of the organization.
  • Pull requests feature (that made GitHub so well known): GitHub UI helps you visualize clearer what is about to be merged in the default branch or the branch of your choice. Pull requests are reviewable with an enhanced diff view. You can easily revert them with a simple button on GitHub and they can be tested before merging, if a Continuous Integration service is enabled in the project.
  • GitHub Pages: At the end of the year 2008, GitHub announced GitHub Pages, a static-site hosting service. Static sites have met a great rise during the past years and GitHub played a big part in it. A static site is a site that contains pages written in HTML, CSS, and Javascript. No server code, such as php, ruby, and Python is included.
  • User and Repository management: As a user, there is a lot of information you can set up in your user settings page, such as associating more than one e-mail to your account, adding multiple SSH keys, or setting up two-factor authentication. Similarly, some functionalities of a repository can be set up via its settings page. For example, you can enable or disable the wiki pages, or completely disable the issue tracker. About the repository management, there are quite a few settings one can fiddle with at the repository level. To access these settings, search for the wrench icon on the right sidebar.