Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SpringTest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
測試專案
SpringTest
Commits
abe43063
Commit
abe43063
authored
Sep 10, 2018
by
楊慶堂
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改用 AspectJ 處理 Transaction,讓內部互 call 的 transation 能夠生效
parent
8d872b71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
2 deletions
+73
-2
pom.xml
pom.xml
+70
-2
src/main/java/org/ylhealth/ym/springtest/SpringTestApplication.java
...ava/org/ylhealth/ym/springtest/SpringTestApplication.java
+3
-0
No files found.
pom.xml
View file @
abe43063
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
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>
...
...
@@ -15,7 +16,7 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.15.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
<relativePath
/>
<!-- lookup parent from repository -->
</parent>
<properties>
...
...
@@ -53,6 +54,16 @@
<groupId>
com.microsoft.sqlserver
</groupId>
<artifactId>
mssql-jdbc
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjrt -->
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjrt
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects -->
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-aspects
</artifactId>
</dependency>
</dependencies>
<build>
...
...
@@ -61,7 +72,64 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<version>
1.6
</version>
<executions>
<execution>
<goals>
<goal>
compile
</goal>
<!-- <goal>test-compile</goal> -->
</goals>
</execution>
</executions>
<configuration>
<complianceLevel>
1.7
</complianceLevel>
<forceAjcCompile>
true
</forceAjcCompile>
<weaveDirectories>
<weaveDirectory>
${project.build.outputDirectory}
</weaveDirectory>
</weaveDirectories>
<aspectLibraries>
<aspectLibrary>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-aspects
</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>
org.eclipse.m2e
</groupId>
<artifactId>
lifecycle-mapping
</artifactId>
<version>
1.0.0
</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<versionRange>
[1.0,)
</versionRange>
<goals>
<goal>
test-compile
</goal>
<goal>
compile
</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute
/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
...
src/main/java/org/ylhealth/ym/springtest/SpringTestApplication.java
View file @
abe43063
...
...
@@ -2,8 +2,11 @@ package org.ylhealth.ym.springtest;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.AdviceMode
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@SpringBootApplication
@EnableTransactionManagement
(
mode
=
AdviceMode
.
ASPECTJ
)
public
class
SpringTestApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment