Tests failing with lombok and apt gradle plugin - build.gradle

I have a project with mapstructs and lombok based on the mapstruct-examples/mapstruct-lombok/ but with latests versions and tests part is not working.
Even adding lombok dependency in testCompile the lombok annotations used in tests are failing when executing gradle test task.
The problem starts when I add the apt plugin:
plugins {
id 'net.ltgt.apt' version '0.13'
}
and the apt at depencencies:
dependencies {
...
apt "org.mapstruct:mapstruct-processor:${mapstructVersion}", "org.projectlombok:lombok"
...
}
At this point the lombok annotations stop working and fails in compilaJavaTest gradle task.
Not adding apt plugin makes lombok work properly but then I can't use mapstructs
Any idea?
Thanks.

Solved using testApt and the corresponding depencencies.

Related

Passing the ArchiveName to UploadArchives in gradle

Having migrated from Spring Boot 1.5.19 to Spring Boot 2.0.4, we are encountering problems with the build on jenkins. Using gradle 4.2.1. We think the behavioural changes in the spring boot gradle plugin between the versions is causing our issue.
The spring Boot gradle plugin has also been updated from 1.5.19 to 2.0.4
Our target artefact naming convention is :
project-name-<version>-<branch>-RELEASE.jar
The jar file gets generated correctly, having specified the following in the build.gradle file.
bootJar {
baseName = 'project_name'
}
The problem occurs when the uploadArchives task is executed. This task looks for an artefact with the following naming convention.
<path-folder-name>-<version>-<branch>-RELEASE.jar
where is the name of the folder path on the jenkins.
It doesn’t seem to be picking up the baseName config.
The build pipeline runs successfully when we don’t perform the uploadArchives task. Also, prior to the Spring Boot upgrade, this was not an issue.
Is there a way to get uploadArchives task to look for the generated jar file name?
I resolved this eventually by adding a settings.gradle file and defining a a root project name in that
rootProject.name = "project_name"
I think the upgrading of the spring Boot gradle plugin must have changed the way the project was being defined.
The 1.5.* version seemed to be taking the project name from the baseName in the Jar task, but the newer version was using the folder name where the app sits.
That was fun

When upgrading Angular 6to 8, I get incompatible peer dependency (using ng update #angular/core)

I'm using this command ng update #angular/cli #angular/corefor to update angular version from 6 to 8 but it showing this bellow problem.
Package "#nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "#angular/core" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Package "#nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "#angular/common" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Package "#nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "#angular/platform-server" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Incompatible peer dependencies found. See above.
When upgrading from Angular 8.2 to 10, I received a similar error. Running:
npm uninstall #nguniversal/module-map-ngfactory-loader
and then ng update worked for me.
first, check the dependencies one by one from the last one and use bellow code fore example :
npm uninstall #angular/http
And again use:
ng update #angular/cli #angular/core
Now you have to check what is your dependencies then one by one remove and after all, you will see your code will be updated.
then from last dependencies, you have to install your new version of your dependencies.

PHP Composer "require" OR condition with version in future

I need to use a bugfix which has not been released yet. Can I use something like:
"bower-asset/yii2-pjax": "2.0.6 | dev-master#18a9183d578d81fb9dbb1c604daba48815c3ebd5 as 2.0.5"
or
"bower-asset/yii2-pjax": "2.0.6 | dev-master as 2.0.5"
in my composer.json? Where 2.0.6 is the stable version in future and dev-master#hash is the commit including the bugfix, now available in remote repo (#master).
While trying to install this package, I discovered that it has a dependency (thanks to lichunqiang).
Here is how to install the dependency and the package:
composer require "fxp/composer-asset-plugin:~1.1.1"
composer require "bower-asset/yii2-pjax:dev-master"
For some reason, composer require "bower-asset/yii2-pjax:2.0.6" does not work, it seems that composer-asset-plugin, the Composer plugin which is used to install the Bower asset does not find any corresponding version.
The current version of Composer is broken, it returns this error:
[ErrorException]
Illegal offset type in isset or empty
You can get back to the old version by rolling back:
composer self-update --rollback

gulp tasks execution in bamboo

I have added npm task to install all my dependencies in bamboo. This command is working successfully. Now I want add gulp task. I have added nodeJS addon in my bamboo plan. Using this I want to execute the gulp command (e.x : gulp minify). I am not able to find the way how to execute this command. Can someone please help me to resolve this issue.
The Bamboo Node.js Support add-on you referenced features a dedicated Gulp task. I think it is shipped alongside newer versions of Atlassian Bamboo at least, maybe you need a newer version?
The Node.js Bamboo Plugin (Bitbucket) page explains how to Configure dependencies and install modules for it to work:
Add the following dependencies (or devDependencies) to the
package.json file in your Node.js project. These are required if you
want to use the "Grunt 0.4.x", "Gulp", "Bower", "Nodeunit" or "Mocha
Test Runner" tasks.
...
Gulp
gulp (v3.3.2 or newer recommended)
...

packag junit4 not found or ambiguous

I am follow this link, and I try to install Junit4 on Windows XP by using Cygwin.
by use this command:
apt-cyg install bison flex make sed juint4
the result of this command is
Installing junit4
packag junit4 not found or ambiguous
So what is the main cause for this problem?
Cygwin's package manager (apt-cyg) doesn't have any JUnit packages built in. The instructions you're reading are for other platforms, like Ubuntu, which does have a package named "junit4".
Luckily, JUnit is only two JAR files, so you should be able to install it very easily yourself.