-
Notifications
You must be signed in to change notification settings - Fork 874
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
fix wrong maven dependency versions in binariesembedded-list. #5939
fix wrong maven dependency versions in binariesembedded-list. #5939
Conversation
@mbien I'm very sorry for the overhead. groupid for commons-codec is wrong should be commons-codec:commons-codec:1.11 (not seen commons-codec in org.apache.commons) |
cc6d533
to
1dce54b
Compare
updated |
1dce54b
to
7ae5124
Compare
quickly wrote a util which generates a maven dependency section: package dev.mbien.embedderlist;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Stream;
/**
* @author mbien
*/
public class Embedderlist {
public static void main(String[] args) throws IOException, InterruptedException {
Path path = Path.of("/home/mbien/NetBeansProjects/netbeans/java/maven.embedder/external/binariesembedded-list");
StringBuilder sb = new StringBuilder();
sb.append(
"""
<?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" 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>
<groupId>com.mycompany</groupId>
<artifactId>mavenproject1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
</properties>
<dependencies>
"""
);
try(Stream<String> lines = Files.lines(path)) {
// 321C614F85F1DEA6BB08C1817C60D53B7F3552FD;org.fusesource.jansi:jansi:2.4.0
lines.filter(l -> !l.startsWith("#") && l.contains(";"))
.map(l -> l.substring(l.indexOf(';')+1))
.forEach(l -> {
String[] comp = l.split("\\:");
sb.append(
"""
<dependency>
<groupId>%s</groupId>
<artifactId>%s</artifactId>
<version>%s</version>
</dependency>
""".formatted(comp[0], comp[1], comp[2]));
});
}
sb.append(
"""
</dependencies>
</project>
""");
Path tmp = Files.createTempDirectory("dep-check-o-matic");
Files.writeString(tmp.resolve("pom.xml"), sb.toString());
new ProcessBuilder(List.of("mvn", "clean", "install"))
.directory(tmp.toFile())
.redirectError(tmp.resolve("error.log").toFile())
.redirectOutput(tmp.resolve("out.log").toFile())
.start()
.waitFor();
System.out.println("##############################");
System.out.println(Files.readString(tmp.resolve("out.log")));
System.out.println("##############################");
}
} then pasted it into a project and hit clean build. This found another typo which I fixed. |
@mbien you and me both in different ways! 😄 master...neilcsmith-net:netbeans:fix-binaries-embedded-version Please consider the test task update - run using |
update ant task a bit. Co-authored-by: Neil C Smith <neilcsmith@apache.org>
7ae5124
to
2c3ee44
Compare
applied the changes to the ant task. We should probably store the dependencies in a pom right away and let ant parse it :) gives us editor support and error checks for free. |
Thanks. Well, I'd certainly like to generate the list and hashes from the info in the jars. A job for NB19! @ebarboni is the checkhash task run at any point? |
requesting a sync back to master once its on delivery so that I can do the same thing again for maven 3.9.2 in the other PR |
Don't worry. Anything added to delivery until the release will be synced to master. May be a few days, until after 18-rc4 is built. |
checkhash is to be run manually If I remember well. Helper only. But the javax.annotation is generated well on the pom because hash is populated first bcevause getallmavencoordinate build a concat of every binaries-list + binariesembeded-list. I guess first found first returned. I think downloading with "normal" download of external should fail also. it could be an option maybe. |
in nbbuild/build.xml
this task is the one used mostly during build => may be hacked too but have to understand it first ;D
|
@ebarboni well, we could also change the extraction task in <target name="-release.files" depends="projectized.-release.files">
<mkdir dir="${cluster}/maven"/>
<unzip src="external/${bundled.maven}-bin.zip" dest="${cluster}/maven">
<mapper type="glob" from="${bundled.maven}/*" to="*"/>
</unzip>
<taskdef name="checkjarssha1" classname="org.netbeans.nbbuild.extlibs.CheckEmbeddedBinaries" classpath="${nbantext.jar}"/>
<mkdir dir="build/tmptesting"/>
<unzip src="external/${bundled.maven}-bin.zip" dest="build/tmptesting">
<patternset>
<include name="**/*.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<checkjarssha1 dir="build/tmptesting" shalist="external/binariesembedded-list" />
<delete dir="build/tmptesting"/>
</target> |
Anyway, for delivery are we OK with merging this as it is now? |
should be correct now
|
No description provided.