-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes StackOverflow in maven dependency resolution
fixes #6147 Signed-off-by: Juergen Albert <[email protected]>
- Loading branch information
1 parent
035bab9
commit 037ffab
Showing
5 changed files
with
146 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-large/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
59 changes: 59 additions & 0 deletions
59
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-large/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<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> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>3.3.2</version> | ||
<relativePath /> <!-- lookup parent from repository --> | ||
</parent> | ||
|
||
<artifactId>resolve-from-dependencies</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-maven-plugin</artifactId> | ||
<version>${bnd.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
<version>${bnd.version}</version> | ||
<configuration> | ||
<failOnChanges>false</failOnChanges> | ||
<!-- Default to including *.bndrun <bndruns> | ||
<bndrun>test.bndrun</bndrun> | ||
</bndruns> --> | ||
<includeDependencyManagement>true</includeDependencyManagement> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>resolve</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
27 changes: 27 additions & 0 deletions
27
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-large/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.lib.io.IO; | ||
|
||
// The resolve-from-dependencies case | ||
|
||
// Check the bndrun file exist! | ||
File bndrunFile = new File(basedir, 'test.bndrun') | ||
assert bndrunFile.isFile() | ||
|
||
// Load the BndEditModel of the bndrun file so we can inspect the result | ||
Processor processor = new Processor() | ||
processor.setProperties(bndrunFile) | ||
BndEditModel bem = new BndEditModel(Workspace.createStandaloneWorkspace(processor, bndrunFile.toURI())) | ||
Document doc = new Document(IO.collect(bndrunFile)) | ||
bem.loadFrom(doc) | ||
|
||
// Get the -runbundles. | ||
def bemRunBundles = bem.getRunBundles() | ||
assert bemRunBundles | ||
assert bemRunBundles.size() > 0 | ||
|
||
StringBuilder sb = new StringBuilder() | ||
bemRunBundles.get(0).formatTo(sb) | ||
assert sb.toString().startsWith("org.freemarker.freemarker") |
2 changes: 2 additions & 0 deletions
2
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-large/test.bndrun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-runfw: org.apache.felix.framework | ||
-runrequires: osgi.identity;filter:='(osgi.identity=org.freemarker.freemarker)' |