Adding a Spring Data Module - spring-data

I'd like to publish the OrientDB Spring Data module:
https://github.com/orientechnologies/spring-data-orientdb/tree/develop
But the OrientDB team can't publish it, because it's under the Spring package:
<groupId>org.springframework.data</groupId>
What's the procedure to release it on Maven Repository? Should we change the package name? It would be community-driven, but still official?

Related

How to dynamically recompile and deploy Java project that a Spring Boot project is dependent upon?

I have a Spring Boot Maven project that has Spring Boot DevTools enabled so that when I change code in the project it will automatically get reloaded.
I also have a dependent project that I'm referencing in the pom.xml:
<dependency>
<groupId>com.mygroupid</groupId>
<artifactId>common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
I would also like the same functionality in the dependent project so that when I make a code change in that project, then the parent project will pick up the change dynamically and reload.
Is this possible? With Spring Boot devtools?
Using Maven modules worked for me. I was unfamiliar with modules but after looking at some examples I got it to work...making a change in my dependent project now automatically causes the Spring Boot project to refresh and pick up the change.
I found this guide helpful since I was working in Eclipse.
I created a new parent project and made my Spring Boot project and the dependent project as "modules" in the new parent project. I initially tried to make the Spring Boot project the "parent" but that didn't fly...I got into some kind of infinite loop of building when I tried that.

Does Spring Data JPA internally use Hibernate & why my app is working if I am not giving dialect property?

I just started learning Spring Data JPA, I connected to mysql in localhost and able to save a record but I am unable to understand why it is working if I am not giving dialect property in properties file and is hibernate a default implementation of spring data instead of ibatis or Eclispe link, because in my pom.xml I just added the dependency of spring-data-jpa and never mentioned what kind of JPA implementation I want to use.
application.properties
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.
spring.datasource.url=jdbc:mysql://localhost:3306/initsoftware
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=ppppppp
spring.datasource.password=xxxxxxx
logging.level.root=DEBUG
spring.jpa.show-sql=true
Since you have an application.properties I assume you are using Spring Boot and not just Spring Data JPA.
In order to use JPA with Spring Boot you would typically add spring-boot-starter-data-jpa to your dependencies. This indeed comes with Hibernate out of the box as you can see when you inspect the dependencies.
Spring Data JPA itself doesn't come with a JPA implementation. You have to add that.
iBatis is not a JPA implementation.
If the assumption above doesn't match your scenario you can use the maven dependency plugin to inspect your (transient) dependencies. The following is a good starting point.
mvn dependency:tree -Dverbose
If you use a different build tool, it probably has a similar feature.

liferay-7 dynamic data lists hook

Hi I would like to create hook on Dynamic data lists in liferay 7.
Unfortunately I am not able to achieve DDLRecordServiceWrapper, according to source code it should be accessible under
import com.liferay.dynamic.data.lists.service.DDLRecordServiceWrapper;
But this class, nor service package are resolved.
In Liferay 6.x this service was available under
com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceWrapper
Is it possible to create DDL hook on liferay-7 somehow?
While using maven, this wrapper can be found inside this artifact
<dependency>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.dynamic.data.lists.api</artifactId>
<version>2.1.2</version>
</dependency>
And referenced as
import com.liferay.dynamic.data.lists.service.DDLRecordServiceWrapper;
Using only liferay SDK I wasn't able to get this.

How to set Maven dependencies on a local jar file

I am starting to play around with Maven, to see whether we could use it in the future to handle our dependency management, and IDE environments.
I have looked at some YouTube vids on how to get started with Eclipse (we also use Eclipse), and where you basically start off with creating a new project of type Maven. I have done this, and imported my existing source into the src/main package type.
Now I want to start adding the dependencies. No changes to my pom file yet.
I have two directories with jar files in them, and I need to set those dependencies in the pom file.
How do I do that?
This is not how you usually use Maven. You can add a jar through a path
<dependency>
<groupId>org.javap.web</groupId>
<artifactId>testRunWrapper</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/testRunWrapper.jar</systemPath>
</dependency>
but the recommended way is to draw your jars from a Maven repository (like MavenCentral, or your Nexus/Artifactory).
So if you want to use Maven in your company, make sure you have a running Nexus or Artifactory server in your company as well. Then you can either proxy external Maven repositories (which contain most of the available open source components) or upload your own jars through the interface of your Nexus/Artifactory.

How should you load Spring related jar in Eclipse?

I new with spring and is following the example from "Spring in Action 3rd Edition".
I want to run the code from the example, so I copied the code.
I install Spring STS suite and have a test spring project. It seems it doesn't include spring's jar implicitly so I need to configure the build path and include and jar one by one.
And jar is in some strange location too (I think they are installed by Spring STS, although I have no idea whether it include Spring itself).
And the spring core depends on common logging from apache:
And I need to go to apache common logging site to download the jar and put it in the lib folder of the project, then set it in the build path.
The whole process is unbearable. What if spring got 20 jars? Is there other way to do this?
Thanks all.
To ease the pain of getting the dependencies, it's highly recommended that you use Maven.
All you need to get started is the following :
Checkout this 5 minute start for Apache Maven.
I have a 'Helloworld' Spring + Maven project (specifically to work with Spring In Action, I might add) setup on Git Hub which should get you started without any hassle.
If you are familiar with GIT then fork this repository otherwise,
Download the whole project as a zip/tarball from here.
This project can also be used as the starting point for a Spring app. Read more about how to get the Spring dependencies using Maven here.
Once you do that a mvn clean install inside the project directory is all you need to get all the required dependencies and there is no manual mucking about to get the jars, put them in the classpath and so on and so forth.
There should be a file called pom.xml in the root folder of your project. It contains all the dependencies.
Add this code block inside of the <dependencies> element:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
This will add the missing dependency to your project. Alternatively, right click on pom.xml and select Maven -> Add Dependency ... and then type commons-logging in the search field. The editor will add the dependency in the right place when you click OK.