Injection Dependy of a Multimodule Maven project in Maven - spring-boot

I have the following issue.
On one hand I have a multi module maven project, which I use maven install to write the .jar files in my local .m2 repository. This is working fine. Lets call it MultiA.
Now on the other hand, I have a spring boot project (lets call it SpringB) in which I bind the .jar files from my multi module maven project. This is working fine as well. When I execute my buisness logic from IntelliJ, I receive no issue, but when I build the project as a .jar, I receive an issue because the settings.properties file from MultiA are not found. I do not try to access settings.properties from SpringB, but I call a method from MultiA, which in return trys to access the settings properties.
I hope, this description helps and someone knows the answer to this problem.

Related

Not able to load multiple ( 200+ )external jars from my /lib folder into my Sprirngboot maven/gradle project

I will need to load 200+ external jars( form my local harddisc) into Springboot REST project. Tried many approaches but none of them are working, Much appreciated if someone has solution.
Note: Please do not suggest mvn install or system scope as i need to construct artifacts for 200+ jar's which i dont like to do manually
Tried google add jar's plugin too its just copying the ${basedir}/lib/*.jars into my Maven target folder but not found in runtime.
If your company works with Maven, it should run a Maven repository server like Nexus or Artifactory. When someone builds artifacts, they should be deployed to the Nexus/Artifactory and can then easily be read from there.
If this is not the case and you do not have a Nexus/Artifactory, you need to either install the JARs in your local repository (mvn install:install-file) or you need structure them in the standard repository layout (like log4j/log4j/1.2.17/log4j-1.2.17.jar) and import this directory as repository.
In any case, this will be a lot of manual work (as you already said).

Jar file not getting added in to a external Libraries in Intellij

I am trying to work on a spring-security project in which i have added the spring security dependency via pom.xml file.But as my maven completed its build successfully,its not getting added in the external library.
Please find my the screenshots below:
pom.xml file:
External Library
Dependencies added after successful maven build :
Tried to create a new project to check whether the above issues persist there as well,but there its working as expected as i am able to get the required java files.So the issue is only relevant to the above project.
I even tried to do the steps mentioned from the below links apart from the maven life cycle steps,but that also did not work out
link

cannot find service.jar file custom portlet liferay

I am using liferay 6.2 & built a maven portlet and working fine, I want to use its tables to store data for another portlet so that I need its services in this portlet.
But we can't access it externally so i find a way something like: required-deployment-contexts=Portlet-Project1 inside liferay-plugin-package.properties, then found its works for Ant only.
I was also finding the xxx-portlet-service.jar but didn't able to, so that i could manually put it in other portlet's lib folder i.e inside tomcat-webapps-xxxportlet-WEB-INF.
Just want to find how to use xxxLocalService.util in other in maven portlet
The best approach you can implement is a plugin to manage all the interaction with the DB.
First of all you must create a Service with a maven project and include it into your pom.xml in each portlet that you need. Then you can invoke its methods whenever you want because each portlet will store the dependencies.
Create Service Plugin into jar file
Rebuild with mvn clean liferay:build-service
Custom your own methods to manage the iteraction with the DB (LocalServiceUtilImpl and rebuild).
Include this plugin into pom.xml portlets
Rebuild your portlet.
The JAR will be placed in your .m2 folder, then each time that you rebuild your Service Plugin will be updated.
If i understood your question correctly, You need to create service builder project using maven and then you can add as dependency in other project wherever you need access to use xxxLocalServicutil class.
You can follow below link to create maven service builder project.
http://www.liferay-guru.com/how-to-use-liferay-servicebuilder-archetype/
As you mentioned in your question.
was also finding the xxx-portlet-service.jar but didn't able to, so
that i could manually put it in other portlet's lib folder
To answer this, manually putting .jar file in lib directory will not help when you are working with maven project

Maven ships dependencies inside war but not in jar

I have two maven projects, one (I will call it core) is an ejb-jar (ejb) and the other a war (client).
My client project consumes some ejbs inside my core...so far so good.
But I'm getting a ClassNotFoundException inside my core application because it can't find one class from apache-beanutils...I have set this dependency with compile scope in it's pom.xml but it does not get shipped inside the output jar.
When I check my client.war package I see every compile-scoped dependency inside the WEB-INF/lib folder...but in my core.jar I don't see any of it's dependencies...I'm totally confused about this.
Can someone help me? I tried to google it before asking but I didn't find anything useful so far..thanks.
You can use the maven assembly plugin to bundle all the jars in one super jar.
See this: question

Library to create and upload jar dynamically to maven repository

I have service based environment in which I have to create a jar and upload it dynamically to maven repository and return the dependency tree for it. Is there any library which will create a jar file and upload that jar file to maven repository and will return me dependecny of uploaded jar. Right now Im creating it with maven goals in eclipse but I don't want that.
Thanks,
If you don't want to use the command line or IDE, have you looked at the Maven API? There's also an 'undocumented' Maven embedder project.
Below are some links that may help you get started, pick the approach that is easier for you, while meeting your requirements:
https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/main/java/hudson/maven/MavenEmbedder.java
http://maven.apache.org/ref/3.0.2/maven-embedder/apidocs/org/apache/maven/cli/MavenCli.html
http://q4e.googlecode.com/svn-history/r819/trunk/plugins/maven/core/src/org/devzuz/q/maven/embedder/internal/EclipseMaven.java
http://developers-blog.org/blog/def../2009/09/18/How-to-resolve-an-artifact-with-maven-embedder

Resources