Skip to content

Conversation

@zrlw
Copy link
Contributor

@zrlw zrlw commented Apr 23, 2025

Revised content:

  1. modified MojoParametersListener#beforeMojoExecution: got cacheState and don't allocate projectExecutions memory if cacheState is disabled.
  2. added sisu-maven-plugin to pom.xml for generating META-INF/sisu/javax.inject.Named which should be included in the maven extension jar.

Cause:
if set maven-build-cache-extension at .mvn/extensions.xml, MojoParametersListener will always allocate memory for saving projectExecutions even disable the cache by -Dmaven.build.cache.enabled=false
0880888504108086c904

this pr is related to
https://issues.apache.org/jira/browse/MBUILDCACHE-123 and apache/dubbo#15328

@zrlw
Copy link
Contributor Author

zrlw commented Apr 23, 2025

by the way, i doubt why sisu-maven-plugin is not included in pom.xml?
i added sisu-maven-plugin to my pom.xml and run mvn clean sisu:main-index install to generate file META-INF/sisu/javax.inject.Named which should be included in maven-build-cache-extension jar.

      <plugin>
        <groupId>org.eclipse.sisu</groupId>
        <artifactId>sisu-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-index</id>
            <goals>
              <goal>main-index</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

@zrlw zrlw force-pushed the MBUILDCACHE-judgeStateAtBeforeMojoExecution branch from aede68f to 7321e11 Compare April 23, 2025 23:26
@olamy olamy added the bug Something isn't working label Apr 24, 2025
@zrlw zrlw changed the title [MBUILDCACHE-xxx] do not set projectExecutions if cacheState is disabled [MBUILDCACHE-123] do not set projectExecutions if cacheState is disabled Apr 24, 2025
@olamy olamy merged commit a9c9f67 into apache:master Apr 25, 2025
31 checks passed
@zrlw
Copy link
Contributor Author

zrlw commented Apr 25, 2025

the pr needs to be optimized since it has duplicated codes and did useless work when the condition source == Source.LIFECYCLE && !forkedExecution is false.
see details at #209

@jira-importer
Copy link

Resolve #288

1 similar comment
@jira-importer
Copy link

Resolve #288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants