Skip to content

Commit

Permalink
Use Shrinkwrap API instead of implementation packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbagu authored and mathbagu committed Sep 29, 2016
1 parent 9f58536 commit 26b66c0
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 36 deletions.
12 changes: 11 additions & 1 deletion case-repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion computation-mpi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion dymola-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystem;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -435,7 +433,7 @@ private List<String> writeDymolaInputs(Path workingDir, List<Contingency> contin
pathStream.filter((p) -> !p.toFile().isDirectory() && p.toFile().getAbsolutePath().contains("events_") && p.toFile().getAbsolutePath().endsWith(".mo")).
forEach(p -> {
GenericArchive archive = ShrinkWrap.createDomain().getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = new ShrinkWrapFileSystem(new ShrinkWrapFileSystemProvider(), archive)) {
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
Files.copy(modelicaPowerSystemLibraryPath, rootDir.resolve(modelicaPowerSystemLibraryPath.getFileName()));
Files.copy(Paths.get(p.toString()), rootDir.resolve(DymolaUtil.DYMOLA_SIM_MODEL_INPUT_PREFIX+".mo"));
Expand Down
12 changes: 11 additions & 1 deletion eurostag-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
import org.jboss.shrinkwrap.api.GenericArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystem;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider;
import org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -252,7 +251,7 @@ private static void dumpLimits(EurostagDictionary dictionary, BufferedWriter wri

private static void writeLimits(Network network, EurostagDictionary dictionary, Domain domain, OutputStream os) throws IOException {
GenericArchive archive = domain.getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = new ShrinkWrapFileSystem(new ShrinkWrapFileSystemProvider(), archive)) {
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
// dump first current limits for each of the branches
try (BufferedWriter writer = Files.newBufferedWriter(rootDir.resolve(CURRENT_LIMITS_CSV), StandardCharsets.UTF_8)) {
Expand Down Expand Up @@ -353,7 +352,7 @@ private void writeWp43Configs(List<Contingency> contingencies, Path workingDir)
private void writeWp43Configs(Domain domain, List<Contingency> contingencies, OutputStream os) throws IOException, ConfigurationException {
// copy wp43 configuration files
GenericArchive archive = domain.getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = new ShrinkWrapFileSystem(new ShrinkWrapFileSystemProvider(), archive)) {
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
writeWp43Configs(contingencies, rootDir);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import org.jboss.shrinkwrap.api.Domain;
import org.jboss.shrinkwrap.api.GenericArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystem;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider;
import org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems;

import java.io.BufferedWriter;
import java.io.IOException;
Expand Down Expand Up @@ -254,7 +253,7 @@ public GenericArchive writeFaultSeqArchive(List<Contingency> contingencies, Netw

public GenericArchive writeFaultSeqArchive(Domain domain, List<Contingency> contingencies, Network network, EurostagDictionary dictionary, Function<Integer, String> seqFileNameFct) throws IOException {
GenericArchive archive = domain.getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = new ShrinkWrapFileSystem(new ShrinkWrapFileSystemProvider(), archive)) {
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
for (int i = 0; i < contingencies.size(); i++) {
Contingency contingency = contingencies.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
import org.jboss.shrinkwrap.api.GenericArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystem;
import org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider;
import org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -161,7 +160,7 @@ public String getVersion() {

private void writeDtaAndControls(Domain domain, OutputStream ddbOs, OutputStream dictGensOs) throws IOException {
GenericArchive archive = domain.getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = new ShrinkWrapFileSystem(new ShrinkWrapFileSystemProvider(), archive)) {
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
ddbClient.dumpDtaFile(rootDir, DTA_FILE_NAME, network, parallelIndexes.toMap(), EurostagUtil.VERSION, dictionary.toMap());
}
Expand Down
4 changes: 2 additions & 2 deletions eurostag-step-up-transformer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api-nio2</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
12 changes: 11 additions & 1 deletion file-system-rules-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions iidm-import-export-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
4 changes: 2 additions & 2 deletions iidm-xml-import-export/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
12 changes: 11 additions & 1 deletion mmap-offline-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>eu.itesla_project</groupId>
<artifactId>iidm-network-test</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion offline-workflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
8 changes: 0 additions & 8 deletions pclfsim-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,24 @@
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<artifactId>shrinkwrap-api</artifactId>
<version>${shrinkwrap.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api-nio2</artifactId>
<version>${shrinkwrap.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<version>${shrinkwrap.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-nio2</artifactId>
<version>${shrinkwrap.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down

0 comments on commit 26b66c0

Please sign in to comment.