Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository build command not working #1009

Open
hohwille opened this issue Jan 31, 2025 · 1 comment
Open

Repository build command not working #1009

hohwille opened this issue Jan 31, 2025 · 1 comment
Labels
bug Something isn't working build meta-build commandlet (ide build) repository Commandlet to clone, build or import git repositories

Comments

@hohwille
Copy link
Member

Expected behavior

As a IDEasy user, I want to be able to configure a build command for my repository so that the repository is not only cloned but also build during the setup.

Actual behavior

As it seems this was configured properly:

build_command=mvn -DskipTests=true clean install

But it did not have any effect.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ide create mmm https://github.com/m-m-m/settings.git
  2. Check for `mmm/workspaces/main/base/*/target - was not created so maven was not invoked even though configured.

Related/Dependent Issues

#954

Comments/Hints:

I am slightly confused why it is not working:

buildRepository(repositoryConfig, repositoryPath);

And:
private boolean buildRepository(RepositoryConfig repositoryConfig, Path repositoryPath) {
String buildCmd = repositoryConfig.buildCmd();
if (buildCmd != null && !buildCmd.isEmpty()) {
return this.context.newStep("Build repository via: " + buildCmd).run(() -> {
String[] command = buildCmd.split("\\s+");
ToolCommandlet commandlet = this.context.getCommandletManager().getRequiredToolCommandlet(command[0]);
commandlet.reset();
for (int i = 1; i < command.length; i++) {
commandlet.arguments.addValue(command[i]);
}
Path executionDirectory = repositoryPath;
String path = repositoryConfig.buildPath();
if (path != null) {
executionDirectory = executionDirectory.resolve(path);
}
commandlet.setExecutionDirectory(executionDirectory);
commandlet.run();
});

Affected version:

  • 2025.01.003
@hohwille hohwille added bug Something isn't working repository Commandlet to clone, build or import git repositories labels Jan 31, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jan 31, 2025
@hohwille hohwille added the build meta-build commandlet (ide build) label Jan 31, 2025
@hohwille
Copy link
Member Author

Start: Setup of repository base
The properties file D:\projects\release-test-mmm\settings\repositories\base.properties uses the legacy property git-url instead of git_url
Start: Clone or pull repository
Cloning into '.'...
remote: Enumerating objects: 2009, done.
remote: Counting objects: 100% (748/748), done.
remote: Compressing objects: 100% (404/404), done.
remote: Total 2009 (delta 186), reused 653 (delta 121), pack-reused 1261 (from 1)
Receiving objects: 100% (2009/2009), 349.60 KiB | 15.20 MiB/s, done.
Resolving deltas: 100% (624/624), done.
Successfully ended step 'Clone or pull repository'.
Start: Importing repository base into eclipse
Start: Download artifact org.codehaus.groovy:groovy-ant:3.0.23:jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.devonfw.tools.IDEasy:ide-cli >------------------
[INFO] Building ide-cli 2025.01.003-beta-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- dependency:3.7.0:get (default-cli) @ ide-cli ---
[INFO] Resolving org.codehaus.groovy:groovy-ant:jar:3.0.23 with transitive dependencies
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-ant/3.0.23/groovy-ant-3.0.23.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-ant/3.0.23/groovy-ant-3.0.23.pom (23 kB at 64 kB/s)
[INFO] Artifact org.codehaus.groovy:groovy:pom:3.0.23 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.codehaus.groovy:groovy:pom:3.0.23 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/3.0.23/groovy-3.0.23.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/3.0.23/groovy-3.0.23.pom (0 B at 0 B/s)
[INFO] Artifact org.apache.ant:ant:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.10.14/ant-1.10.14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.10.14/ant-1.10.14.pom (0 B at 0 B/s)
[INFO] Artifact org.apache.ant:ant-parent:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant-parent:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.10.14/ant-parent-1.10.14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.10.14/ant-parent-1.10.14.pom (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-junit/1.10.14/ant-junit-1.10.14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-junit/1.10.14/ant-junit-1.10.14.pom (7.5 kB at 313 kB/s)
[INFO] Artifact org.apache.ant:ant-launcher:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant-launcher:pom:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.10.14/ant-launcher-1.10.14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.10.14/ant-launcher-1.10.14.pom (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-antlr/1.10.14/ant-antlr-1.10.14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-antlr/1.10.14/ant-antlr-1.10.14.pom (4.4 kB at 218 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-groovydoc/3.0.23/groovy-groovydoc-3.0.23.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-groovydoc/3.0.23/groovy-groovydoc-3.0.23.pom (24 kB at 847 kB/s)
[INFO] Artifact org.codehaus.groovy:groovy:jar:3.0.23 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant:jar:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant-launcher:jar:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.codehaus.groovy:groovy:jar:3.0.23 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant:jar:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact org.apache.ant:ant-launcher:jar:1.10.14 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots/, default, snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-ant/3.0.23/groovy-ant-3.0.23.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-ant/3.0.23/groovy-ant-3.0.23.jar (83 kB at 1.8 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/3.0.23/groovy-3.0.23.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.10.14/ant-1.10.14.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-junit/1.10.14/ant-junit-1.10.14.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.10.14/ant-launcher-1.10.14.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-antlr/1.10.14/ant-antlr-1.10.14.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/3.0.23/groovy-3.0.23.jar (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-groovydoc/3.0.23/groovy-groovydoc-3.0.23.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.10.14/ant-1.10.14.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.10.14/ant-launcher-1.10.14.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-antlr/1.10.14/ant-antlr-1.10.14.jar (12 kB at 299 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-groovydoc/3.0.23/groovy-groovydoc-3.0.23.jar (162 kB at 3.7 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/ant/ant-junit/1.10.14/ant-junit-1.10.14.jar (141 kB at 2.9 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.797 s
[INFO] Finished at: 2025-01-31T11:21:59+01:00
[INFO] ------------------------------------------------------------------------
Successfully ended step 'Download artifact org.codehaus.groovy:groovy-ant:3.0.23:jar'.
Jan. 31, 2025 11:22:01 AM org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
!SESSION 2025-01-31 11:22:00.120 -----------------------------------------------
eclipse.buildId=4.33.0.20240905-0613
java.version=21.0.4
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product -keyring C:\Users\hohwille\.eclipse\.keyring
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data D:\projects\release-test-mmm\workspaces\main -keyring C:\Users\hohwille\.eclipse\.keyring -consoleLog

!ENTRY ch.qos.logback.classic 1 0 2025-01-31 11:22:03.770
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
11:22:03.805 [Start Level: Equinox Container: da8877e7-0d70-4d4b-a263-91f26c36f0d1] DEBUG org.eclipse.jgit.internal.util.ShutdownHook -- register org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda/0x00000001002a6608@2ee43fb7 with shutdown hook
11:22:03.805 [Start Level: Equinox Container: da8877e7-0d70-4d4b-a263-91f26c36f0d1] DEBUG org.eclipse.jgit.internal.util.ShutdownHook -- register org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda/0x00000001002a6608@2ee43fb7 with shutdown hook
11:22:06.674 [main] DEBUG org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob -- Queued refresh request: []
11:22:06.674 [main] DEBUG org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob -- Queued refresh request: []

!ENTRY ch.qos.logback.classic 1 0 2025-01-31 11:22:06.712
!MESSAGE Logback config file: D:\projects\release-test-mmm\workspaces\main\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.6.1.20240411-1122.xml
Jan. 31, 2025 11:22:17 AM org.apache.lucene.internal.vectorization.VectorizationProvider lookup
WARNUNG: Java vector incubator module is not readable. For optimal vector performance, pass '--add-modules jdk.incubator.vector' to enable Vector API.
Successfully ended step 'Importing repository base into eclipse'.
Successfully ended step 'Setup of repository base'.

So it seems that buildCmd was not set and the if not entered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build meta-build commandlet (ide build) repository Commandlet to clone, build or import git repositories
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant