Passing the ArchiveName to UploadArchives in gradle - build.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

Related

JBoss Fuse Specified service reference is null

I have two bundles, one is DB related and another one simple. DB bundle will export osgi service reference. Another one will get the service reference.
It is working fine when installing one by one. The service reference is null when starting the Jboss fuse karaf container.
Can i set bundle ordering ? or Can i set delay for completing DB bundle?
I need to install bundle after completing DB bundle.
Advance Thanks.
The actual code you have to write depends on how your bundles start. Do you use a Java class as BundleActivator? Spring? Blueprint?
Generally speaking, each bundle must specify its dependencies. There are 2 kinds of dependencies:
dependeny on some classes in packages exported by other bundles
dependency on a service provided by some other bundle
Your bundle should declare packages and services (Java interfaces) it needs. This way you "force" JBoss/Karaf to start bundles in the correct order and avoid null service references.
Have a look at this guide:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html-single/Managing_OSGi_Dependencies/index.html

How do I import Primefaces 6.0 source as maven project in Eclipse?

I followed Building From Source https://github.com/primefaces/primefaces/wiki/Building-From-Source instructions. Building the SNAPSHOT version project from command works well.
However, importing it into eclipse using the Existing Maven Projects wizard gives me a lot of errors in the Problems view. I fixed the lifecycle mappings by setting all to ignore.
I realized the generated source code in the target/generated-sources/maven-jsf-plugin directory but it was not picked up by the m2e plugins as a source folder automatically. So I included it into the eclipse build path manually. But then again, many compile errors show up in the generated code.
Does anybody use eclipse as IDE for primefaces development? How do you setup the eclipse project to develop primefaces?
The eclipse project uses Java Compiler compliance level 1.5 derived from the pom.xml maven-compiler-plugin settings. Setting the Java Compiler compliance level to 1.6 solved the issue for me.

java.lang.NoClassDefFoundError when already imported jar files to android studio

I receive the error java.lang.NoClassDefFoundError: org.codehaus.jackson.map.ObjectMapper even after adding the Jackson jar files. In Android Studio?
Also tried a few links. Namely this, which did not help.
Edit:
After some research I discovered the root of the error. The dynamo-geo.jar library that is provided by Amazon is inherently flawed in that it refers to some sort of outdated Jackson version. Upon looking in I can see that the class that is called geoJsonMapper refers to a deprecated version of ObjectMapper from the old 1.x.x versions of Jackson. I opened source code from dynamo-geo.jar here and I edited the ObjectMapper import from the outdated version to import com.fasterxml.jackson.databind.ObjectMapper;.
Now the issue I have is I am not sure if there is a way to compile a JAR file in Android Studio? In order to get the newly updated library into my other Android Studio project?
EDIT:
Solution - read this.
If you are using Jackson 2 then you will want to import com.fasterxml.jackson.databind.ObjectMapper instead of org.codehaus.jackson.map.ObjectMapper. You may also have a mix of Jackson 1 and Jackson 2 JAR files in your classpath.
You should be able to fork dynamodb-geo, make your changes, and use Maven to package the new JAR file (run the command mvn clean package). The new JAR file would be located in /dynamodb-geo/target/.

gwtprojsonserializer 1.0.4 jar - error serializing arraylist

I am using gwtprojsonserializer to convert objects to JSON. I've added the version 1.0.4 jar I downloaded from the website http://code.google.com/p/gwtprojsonserializer/ but although the source code on the website includes functionality for serializing arraylists, it is not included in the jar and hence i get the following error:
com.kfuntak.gwt.json.serialization.client.SerializationException: Can't find object serializer for java.util.ArrayList
Does anyone know how I can update the jar or use their latest source code?
Thanks in advance.
Its open source project. The entire source code can be easily downloaded from http://code.google.com/p/gwtprojsonserializer/source/browse/#svn%2Ftrunk
I am assuming the required code for serializing arraylists is in trunk. You can add/remove/modify on you local copy. Build the jar ( it just requires mvn clean install command)
If you are having local repository, use mvn deploy. Ensure your version id is different to avoid confusion.

Spring 3 MVC on JBoss 5.1: ConflictingBeanDefinitionException

When I try to deploy my application on JBoss 5.1 Spring 3 MVC throw me this stack trace: http://pastebin.com/Aah386PJ
Telling me that I have two definition of the same bean in two different packages. The thing is I don't have this IntershipConfigurationController in the controller package, but I have it in controller.internshipConfiguration. I previously add it under the root of controller but I deleted it from SVN and it doesn't appear anymore in the tree.
I cleaned JBoss, Eclipse's project, tried to redeploy it, to restart JBoss, Eclipse, etc. but I can't get this project working while my mates with the same repository can run it with no issue.
I don't know what to do this is really annoying.
I know this can be frustrating sometimes but you might want to know why this could happen. Spring annotation based ant path matcher checks for the class-path with a URI pattern to search for controllers or components. In your case the class-path either has a jar having the previous version of your class or some referencing .class file in your build path.
Make sure you have your project cleaned up and if possible disconnect
from SVN and download the project again.
You could also try CTRL+SHIFT+T to see if your controller is
referenced from any other library.
I finally deleted my JBoss folder, removed the projects from JBoss in Eclipse, extract a proper JBoss, made a clean on JBoss in Eclipse and then redeployed my projects and it's now working.
Nonetheless it's a really strange issue...
Edit :
It was in fact because the build folder at the root of my project was versioned and the old classes were still present.
Now the folder is ignored and removed from the SVN and I've deleted the old classes from my FS.