Skip to content

Commit

Permalink
Merge pull request gudaoxuri#153 from LiuHongcheng/master
Browse files Browse the repository at this point in the history
Optimize dynamically modify Maven Builder instances with javaagent
  • Loading branch information
gudaoxuri authored Aug 8, 2019
2 parents 584d0bc + 62537de commit 05f0cf5
Show file tree
Hide file tree
Showing 28 changed files with 85 additions and 14 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ private void singleThreadedBuild( MavenSession session, ReactorContext callableC
{
try
{
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject( session, callableContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ private Collection<String> toScopes(String classpath) {

public void execute(MavenSession session, List<MojoExecution> mojoExecutions, ProjectIndex projectIndex)
throws LifecycleExecutionException {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext(session, mojoExecutions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;

/**
* <p>
Expand Down Expand Up @@ -137,7 +138,12 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
throws LifecycleExecutionException

{
if (SkipCheck.skip(session.getCurrentProject().getBasedir())) {
if (SkipCheck.skip(session.getCurrentProject().getBasedir())
&& mojoExecutions.stream().map(MojoExecution::getGoal).map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
return;
}
DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public void build(MavenSession session, ReactorContext reactorContext, ProjectBu
for (TaskSegment taskSegment : taskSegments) {
for (ProjectSegment projectBuild : projectBuilds.getByTaskSegment(taskSegment)) {
try {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())) {
if (SkipCheck.skip(projectBuild.getProject().getBasedir())
&& session.getGoals().stream().map(String::toLowerCase)
.anyMatch(s ->
s.contains("ms.dew:dew-maven-plugin:release")
|| s.contains("dew:release")
|| s.contains("deploy"))) {
continue;
}
lifecycleModuleBuilder.buildProject(session, reactorContext, projectBuild.getProject(),
Expand Down

0 comments on commit 05f0cf5

Please sign in to comment.