pom 调整

This commit is contained in:
yulichang 2024-10-29 16:06:15 +08:00
parent 1f3a73056d
commit f2b3308d53
9 changed files with 146 additions and 61 deletions

View File

@ -2,7 +2,7 @@ name: Maven Package
on: on:
release: release:
types: [created] types: [ created ]
jobs: jobs:
build: build:

39
.github/workflows/snapshot.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Maven Package
on:
push:
branches:
- snapshot
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '17'
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central
run: mvn deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

View File

@ -30,7 +30,7 @@ public class MPJInterceptorConfig {
System.out.println(" _ _ |_ _ _|_. ___ _ | _ . _ . _ \n" + System.out.println(" _ _ |_ _ _|_. ___ _ | _ . _ . _ \n" +
"| | |\\/|_)(_| | |_\\ |_)||_|_\\ | (_) | | | \n" + "| | |\\/|_)(_| | |_\\ |_)||_|_\\ | (_) | | | \n" +
" / | /\n" + " / | /\n" +
" 1.5.1"); " 1.5.2-SNAPSHOT");
} }
} }

View File

@ -5,10 +5,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>mybatis-plus-join-root</artifactId>
<version>3.3.4</version> <version>${revision}</version>
<relativePath/>
</parent> </parent>
<groupId>com.github.yulichang</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-test</artifactId> <artifactId>mybatis-plus-join-test</artifactId>
@ -47,9 +46,6 @@
</scm> </scm>
<properties> <properties>
<revision>1.5.2</revision>
<mybatis.plus.version>3.5.8</mybatis.plus.version>
<jdkVersion>17</jdkVersion> <jdkVersion>17</jdkVersion>
<jdkVersion.test>17</jdkVersion.test> <jdkVersion.test>17</jdkVersion.test>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
@ -94,10 +90,19 @@
<artifactId>mybatis-plus-spring-boot3-starter</artifactId> <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>${mybatis.plus.version}</version> <version>${mybatis.plus.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-jsqlparser</artifactId>
<version>${mybatis.plus.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-jdbc</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -34,28 +34,10 @@
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-processor</artifactId>
<version>${revision}</version>
</dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-processor</artifactId>
<version>${revision}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -1,5 +1,6 @@
package com.github.yulichang.test.join.dto; package com.github.yulichang.test.join.dto;
import com.github.yulichang.test.join.entity.AddressDO;
import com.github.yulichang.test.join.entity.UserDO; import com.github.yulichang.test.join.entity.UserDO;
import com.github.yulichang.test.join.enums.Sex; import com.github.yulichang.test.join.enums.Sex;
import lombok.Data; import lombok.Data;
@ -42,6 +43,8 @@ public class UserDTO {
private List<AddressDTO> addressList; private List<AddressDTO> addressList;
private List<AddressDO> addressList11;
private AddressDTO addressDTO; private AddressDTO addressDTO;
private List<Integer> addressIds; private List<Integer> addressIds;

View File

@ -34,7 +34,7 @@ public class PageByMainTest {
"LEFT JOIN address t1 ON (t1.user_id = t.id AND t1.user_id >= ? AND t1.del = false)"); "LEFT JOIN address t1 ON (t1.user_id = t.id AND t1.user_id >= ? AND t1.del = false)");
MPJLambdaWrapper<UserDO> wrapper = JoinWrappers.lambda(UserDO.class) MPJLambdaWrapper<UserDO> wrapper = JoinWrappers.lambda(UserDO.class)
.selectAll() .selectAll()
.selectCollection(AddressDO.class, UserDTO::getAddressList) .selectCollection(AddressDO.class, UserDTO::getAddressList11)
.leftJoin(AddressDO.class, on -> on .leftJoin(AddressDO.class, on -> on
.eq(AddressDO::getUserId, UserDO::getId) .eq(AddressDO::getUserId, UserDO::getId)
.ge(AddressDO::getUserId, 0)) .ge(AddressDO::getUserId, 0))
@ -45,6 +45,7 @@ public class PageByMainTest {
Page<UserDTO> page = wrapper.page(new Page<>(1, 8), UserDTO.class); Page<UserDTO> page = wrapper.page(new Page<>(1, 8), UserDTO.class);
page.getRecords().forEach(System.out::println); page.getRecords().forEach(System.out::println);
assert page.getRecords().size() == 8; assert page.getRecords().size() == 8;
assert !page.getRecords().get(0).getAddressList11().isEmpty();
} }
@Test @Test

View File

@ -12,9 +12,17 @@
<artifactId>mybatis-plus-join-solon-plugin</artifactId> <artifactId>mybatis-plus-join-solon-plugin</artifactId>
<properties> <dependencyManagement>
<solon.version>3.0.1</solon.version> <dependencies>
</properties> <dependency>
<groupId>org.noear</groupId>
<artifactId>solon</artifactId>
<version>3.0.2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
@ -25,19 +33,16 @@
<dependency> <dependency>
<groupId>org.noear</groupId> <groupId>org.noear</groupId>
<artifactId>solon</artifactId> <artifactId>solon</artifactId>
<version>${solon.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.noear</groupId> <groupId>org.noear</groupId>
<artifactId>mybatis-solon-plugin</artifactId> <artifactId>mybatis-solon-plugin</artifactId>
<version>${solon.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.noear</groupId> <groupId>org.noear</groupId>
<artifactId>mybatis-plus-extension-solon-plugin</artifactId> <artifactId>mybatis-plus-extension-solon-plugin</artifactId>
<version>${solon.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

94
pom.xml
View File

@ -43,7 +43,7 @@
</modules> </modules>
<properties> <properties>
<revision>1.5.2</revision> <revision>1.5.2-SNAPSHOT</revision>
<mybatis.plus.version>3.5.9</mybatis.plus.version> <mybatis.plus.version>3.5.9</mybatis.plus.version>
<jdkVersion>17</jdkVersion> <jdkVersion>17</jdkVersion>
@ -59,34 +59,84 @@
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>6.1.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>2.0.21</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId> <artifactId>spring-boot-dependencies</artifactId>
<optional>true</optional> <version>3.3.5</version>
<version>3.3.4</version> <scope>import</scope>
<type>pom</type>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<profiles> <profiles>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>maven</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalJOptions>
<additionalJOption>-Xdoclint:none</additionalJOption>
</additionalJOptions>
<charset>UTF-8</charset>
<docencoding>UTF-8</docencoding>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>release</id> <id>release</id>
<build> <build>