Skip to content

Commit a26d599

Browse files
committed
make it module friendlier
Signed-off-by: Stefan Niederhauser <ghuder5@gmx.ch>
1 parent 95c6e8e commit a26d599

8 files changed

Lines changed: 75 additions & 42 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ os:
77

88
env:
99
- JDK="adopt@1.8.0-242"
10+
- JDK="openjdk@1.11"
1011

1112
cache:
1213
directories:

graphviz-java-all-j2v8/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
<version>${project.version}</version>
2323
</dependency>
2424
<dependency>
25-
<groupId>com.eclipsesource.j2v8</groupId>
25+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
2626
<artifactId>j2v8_macosx_x86_64</artifactId>
2727
</dependency>
2828
<dependency>
29-
<groupId>com.eclipsesource.j2v8</groupId>
29+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
3030
<artifactId>j2v8_linux_x86_64</artifactId>
3131
</dependency>
3232
<dependency>
33-
<groupId>com.eclipsesource.j2v8</groupId>
33+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
3434
<artifactId>j2v8_win32_x86_64</artifactId>
3535
</dependency>
3636
<dependency>
37-
<groupId>com.eclipsesource.j2v8</groupId>
37+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
3838
<artifactId>j2v8_win32_x86</artifactId>
3939
</dependency>
4040
</dependencies>

graphviz-java-min-deps/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</exclusion>
3232
<exclusion>
3333
<groupId>org.webjars.npm</groupId>
34-
<artifactId>viz.js-for-graphviz-java</artifactId>
34+
<artifactId>viz.js-graphviz-java</artifactId>
3535
</exclusion>
3636
<exclusion>
3737
<groupId>guru.nidi.com.kitfox</groupId>
@@ -44,30 +44,30 @@
4444
</exclusions>
4545
</dependency>
4646
<dependency>
47-
<groupId>com.eclipsesource.j2v8</groupId>
47+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
4848
<artifactId>j2v8_macosx_x86_64</artifactId>
4949
<optional>true</optional>
5050
</dependency>
5151
<dependency>
52-
<groupId>com.eclipsesource.j2v8</groupId>
52+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
5353
<artifactId>j2v8_linux_x86_64</artifactId>
5454
<optional>true</optional>
5555
</dependency>
5656
<dependency>
57-
<groupId>com.eclipsesource.j2v8</groupId>
57+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
5858
<artifactId>j2v8_win32_x86_64</artifactId>
5959
<optional>true</optional>
6060
</dependency>
6161
<dependency>
62-
<groupId>com.eclipsesource.j2v8</groupId>
62+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
6363
<artifactId>j2v8_win32_x86</artifactId>
6464
<optional>true</optional>
6565
</dependency>
6666

6767
<!-- Only needed for Javascript Graphviz Engines -->
6868
<dependency>
6969
<groupId>org.webjars.npm</groupId>
70-
<artifactId>viz.js-for-graphviz-java</artifactId>
70+
<artifactId>viz.js-graphviz-java</artifactId>
7171
<optional>true</optional>
7272
</dependency>
7373

graphviz-java/pom.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

56
<parent>
@@ -66,7 +67,7 @@
6667
<!-- Only needed for Javascript Graphviz Engines -->
6768
<dependency>
6869
<groupId>org.webjars.npm</groupId>
69-
<artifactId>viz.js-for-graphviz-java</artifactId>
70+
<artifactId>viz.js-graphviz-java</artifactId>
7071
</dependency>
7172
<!-- Only needed for SALAMANDER renderer -->
7273
<dependency>
@@ -135,7 +136,7 @@
135136
</activation>
136137
<dependencies>
137138
<dependency>
138-
<groupId>com.eclipsesource.j2v8</groupId>
139+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
139140
<artifactId>j2v8_macosx_x86_64</artifactId>
140141
<scope>compile</scope>
141142
</dependency>
@@ -150,7 +151,7 @@
150151
</activation>
151152
<dependencies>
152153
<dependency>
153-
<groupId>com.eclipsesource.j2v8</groupId>
154+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
154155
<artifactId>j2v8_linux_x86_64</artifactId>
155156
<scope>compile</scope>
156157
</dependency>
@@ -166,7 +167,7 @@
166167
</activation>
167168
<dependencies>
168169
<dependency>
169-
<groupId>com.eclipsesource.j2v8</groupId>
170+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
170171
<artifactId>j2v8_win32_x86</artifactId>
171172
<scope>compile</scope>
172173
</dependency>
@@ -182,7 +183,7 @@
182183
</activation>
183184
<dependencies>
184185
<dependency>
185-
<groupId>com.eclipsesource.j2v8</groupId>
186+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
186187
<artifactId>j2v8_win32_x86_64</artifactId>
187188
<scope>compile</scope>
188189
</dependency>

graphviz-java/src/main/java/guru/nidi/graphviz/engine/AbstractJsGraphvizEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import static java.util.stream.Collectors.joining;
2727

2828
public abstract class AbstractJsGraphvizEngine extends AbstractGraphvizEngine {
29-
private static final String VIZ_BASE = "META-INF/resources/webjars/viz.js-for-graphviz-java/2.1.3/";
29+
private static final String VIZ_BASE = "META-INF/resources/webjars/viz.js-graphviz-java/2.1.3/";
3030
static final boolean AVAILABLE = isOnClasspath(VIZ_BASE + "viz.js");
3131
private static final Pattern FONT_NAME_PATTERN = Pattern.compile("\"?fontname\"?\\s*=\\s*\"?(.*?)[\",;\\]]");
3232
private static final Map<Class<?>, ThreadLocal<EngineState>> ENGINES = new HashMap<>();
@@ -36,7 +36,7 @@ protected AbstractJsGraphvizEngine(boolean sync, Supplier<JavascriptEngine> engi
3636
super(sync);
3737
if (!AVAILABLE) {
3838
throw new MissingDependencyException("Javascript engines are not available.",
39-
"org.webjars.npm:viz.js-for-graphviz-java");
39+
"org.webjars.npm:viz.js-graphviz-java");
4040
}
4141
this.engineSupplier = engineSupplier;
4242
}

graphviz-java/src/test/java/guru/nidi/graphviz/CodeAnalysisTest.java

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
import edu.umd.cs.findbugs.Priorities;
1919
import guru.nidi.codeassert.checkstyle.*;
20-
import guru.nidi.codeassert.config.AnalyzerConfig;
21-
import guru.nidi.codeassert.config.In;
20+
import guru.nidi.codeassert.config.*;
2221
import guru.nidi.codeassert.dependency.*;
2322
import guru.nidi.codeassert.findbugs.*;
2423
import guru.nidi.codeassert.junit.CodeAssertJunit5Test;
@@ -33,7 +32,11 @@
3332
import net.sourceforge.pmd.RulePriority;
3433
import org.junit.jupiter.api.Test;
3534

35+
import java.util.ArrayList;
36+
import java.util.List;
37+
3638
import static guru.nidi.codeassert.junit.CodeAssertMatchers.matchesRulesExactly;
39+
import static java.util.Arrays.asList;
3740
import static org.hamcrest.MatcherAssert.assertThat;
3841

3942
class CodeAnalysisTest extends CodeAssertJunit5Test {
@@ -70,28 +73,31 @@ protected Model createModel() {
7073

7174
@Override
7275
protected FindBugsResult analyzeFindBugs() {
76+
final List<Ignore> ok = new ArrayList<>(asList(In.loc("Datatype").ignore("NP_BOOLEAN_RETURN_NULL"),
77+
In.loc("TempFiles").ignore("PATH_TRAVERSAL_IN", "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"),
78+
In.loc("Options").ignore("URLCONNECTION_SSRF_FD"),
79+
In.locs("BuiltInRasterizer#rasterize", "NopRasterizer", "PortSource").ignore("NP_NONNULL_RETURN_VIOLATION"),
80+
In.loc("CommandLineExecutor").ignore("DM_DEFAULT_ENCODING"),
81+
In.loc("GraphvizServer").ignore("COMMAND_INJECTION", "CRLF_INJECTION_LOGS"),
82+
In.locs("AbstractGraphvizEngine", "Options", "GraphvizCmdLineEngine", "EngineTest", "SystemUtils", "Renderer").ignore("PATH_TRAVERSAL_IN"),
83+
In.locs("EngineTest", "RendererTest", "EngineResult").ignore("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"),
84+
In.loc("OptionsTest").ignore("DMI_HARDCODED_ABSOLUTE_FILENAME"),
85+
In.loc("SimpleLabel").ignore("IM_BAD_CHECK_FOR_ODD"),
86+
In.loc("JavascriptEngineTest").ignore("PREDICTABLE_RANDOM"),
87+
In.loc("DatatypeTest").ignore("SIC_INNER_SHOULD_BE_STATIC"),
88+
In.loc("SvgElementFinder").ignore("XXE_DOCUMENT"),
89+
In.loc("Communicator").ignore("RR_NOT_CHECKED")));
90+
if (!System.getProperty("java.version").startsWith("1.8")) {
91+
ok.add(In.loc("LinkList").ignore("EQ_DOESNT_OVERRIDE_EQUALS"));
92+
}
93+
7394
final BugCollector collector = new BugCollector().minPriority(Priorities.NORMAL_PRIORITY)
7495
.apply(FindBugsConfigs.dependencyTestIgnore(CodeAnalysisTest.class))
7596
.because("It's examples", In.loc("ReadmeTest").ignore("DLS_DEAD_LOCAL_STORE"))
7697
.because("GraphvizServer is on localhost",
7798
In.locs("GraphvizServer", "GraphvizServerEngine")
7899
.ignore("UNENCRYPTED_SERVER_SOCKET", "UNENCRYPTED_SOCKET"))
79-
.because("It's ok",
80-
In.loc("Datatype").ignore("NP_BOOLEAN_RETURN_NULL"),
81-
In.loc("TempFiles").ignore("PATH_TRAVERSAL_IN", "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"),
82-
In.loc("Options").ignore("URLCONNECTION_SSRF_FD"),
83-
In.locs("BuiltInRasterizer#rasterize", "NopRasterizer", "PortSource").ignore("NP_NONNULL_RETURN_VIOLATION"),
84-
In.loc("CommandLineExecutor").ignore("DM_DEFAULT_ENCODING"),
85-
In.loc("GraphvizServer").ignore("COMMAND_INJECTION", "CRLF_INJECTION_LOGS"),
86-
In.locs("AbstractGraphvizEngine", "Options", "GraphvizCmdLineEngine", "EngineTest", "SystemUtils", "Renderer").ignore("PATH_TRAVERSAL_IN"),
87-
In.locs("EngineTest", "RendererTest", "EngineResult").ignore("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"),
88-
In.loc("OptionsTest").ignore("DMI_HARDCODED_ABSOLUTE_FILENAME"),
89-
In.loc("SimpleLabel").ignore("IM_BAD_CHECK_FOR_ODD"),
90-
In.loc("JavascriptEngineTest").ignore("PREDICTABLE_RANDOM"),
91-
In.loc("DatatypeTest").ignore("SIC_INNER_SHOULD_BE_STATIC"),
92-
In.loc("SvgElementFinder").ignore("XXE_DOCUMENT"),
93-
In.loc("LinkList").ignore("EQ_DOESNT_OVERRIDE_EQUALS"),
94-
In.loc("Communicator").ignore("RR_NOT_CHECKED"));
100+
.because("It's ok", ok.toArray(new Ignore[0]));
95101
return new FindBugsAnalyzer(AnalyzerConfig.maven().mainAndTest(), collector).analyze();
96102
}
97103

@@ -137,7 +143,7 @@ protected PmdResult analyzePmd() {
137143
In.locs("CommandRunnerTest", "AbstractJsGraphvizEngine").ignore("SimplifiedTernary"))
138144
.because("I don't agree",
139145
In.loc("Datatype").ignore("PositionLiteralsFirstInCaseInsensitiveComparisons"),
140-
In.clazz(CommandRunner.class).ignore("OptimizableToArrayCall"),
146+
In.classes(CommandRunner.class, CodeAnalysisTest.class).ignore("OptimizableToArrayCall"),
141147
In.everywhere().ignore("SimplifyStartsWith"))
142148
.because("It's wrapping an Exception with a RuntimeException",
143149
In.locs("Graphviz", "CreationContext", "Datatype").ignore("AvoidCatchingGenericException"));

j2v8-distro/deploy.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
upload() {
2+
VERSION=4.6.0
3+
POM=META-INF/maven/com.eclipsesource.j2v8/$NAME/pom.xml
4+
FILE=$NAME-$VERSION
5+
cd target
6+
rm -rf *
7+
mvn dependency:get -Dartifact=com.eclipsesource.j2v8:$NAME:$VERSION -Ddest=$FILE.jar
8+
mvn dependency:get -Dartifact=com.eclipsesource.j2v8:$NAME:$VERSION -Dclassifier=sources -Ddest=$FILE-sources.jar
9+
unzip -o $FILE.jar META-INF/*
10+
echo "Automatic-Module-Name: $MODULE" >> META-INF/MANIFEST.MF
11+
zip $FILE.jar META-INF/MANIFEST.MF
12+
cp $POM .
13+
sed -i.bak 's|<groupId>com.eclipsesource.j2v8</groupId>|<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>|' pom.xml
14+
#sed -i.bak 's|<version>4.6.0</version>|<version>4.6.0</version>|' pom.xml
15+
sed -i.bak 's|<plugins>|<plugins><plugin><artifactId>maven-antrun-plugin</artifactId><executions><execution><phase>verify</phase><goals><goal>run</goal></goals><configuration><tasks><copy file="${project.build.finalName}.jar" todir="target" overwrite="true"/><copy file="${project.build.finalName}-sources.jar" todir="target" overwrite="true"/></tasks></configuration></execution></executions></plugin>|' pom.xml
16+
mvn deploy -Prelease
17+
#mvn nexus-staging:release -Prelease
18+
cd ..
19+
}
20+
21+
mkdir -p target
22+
#NAME=j2v8_macosx_x86_64 MODULE=j2v8_macosx_x64 upload
23+
NAME=j2v8_linux_x86_64 MODULE=j2v8_linux_x64 upload
24+
NAME=j2v8_win32_x86 MODULE=j2v8_win32_x86 upload
25+
NAME=j2v8_win32_x86_64 MODULE=j2v8_win32_x64 upload

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,33 +80,33 @@
8080
<dependencyManagement>
8181
<dependencies>
8282
<dependency>
83-
<groupId>com.eclipsesource.j2v8</groupId>
83+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
8484
<artifactId>j2v8_macosx_x86_64</artifactId>
8585
<version>${j2v8.version}</version>
8686
<scope>runtime</scope>
8787
</dependency>
8888
<dependency>
89-
<groupId>com.eclipsesource.j2v8</groupId>
89+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
9090
<artifactId>j2v8_linux_x86_64</artifactId>
9191
<version>${j2v8-linux.version}</version>
9292
<scope>runtime</scope>
9393
</dependency>
9494
<dependency>
95-
<groupId>com.eclipsesource.j2v8</groupId>
95+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
9696
<artifactId>j2v8_win32_x86_64</artifactId>
9797
<version>${j2v8.version}</version>
9898
<scope>runtime</scope>
9999
</dependency>
100100
<dependency>
101-
<groupId>com.eclipsesource.j2v8</groupId>
101+
<groupId>guru.nidi.com.eclipsesource.j2v8</groupId>
102102
<artifactId>j2v8_win32_x86</artifactId>
103103
<version>${j2v8.version}</version>
104104
<scope>runtime</scope>
105105
</dependency>
106106

107107
<dependency>
108108
<groupId>org.webjars.npm</groupId>
109-
<artifactId>viz.js-for-graphviz-java</artifactId>
109+
<artifactId>viz.js-graphviz-java</artifactId>
110110
<version>2.1.3</version>
111111
</dependency>
112112
<dependency>

0 commit comments

Comments
 (0)