NetCal / DNC

The NetworkCalculus.org Deterministic Network Calculator
http://dnc.networkcalculus.org
GNU Lesser General Public License v2.1
25 stars 23 forks source link

Download of the rtc.jar fails on certain file systems (FAT, NTFS) #78

Closed sbondorf closed 2 years ago

sbondorf commented 5 years ago

As of version 2.5.2, we have the following in the pom.xml's mpa profile to download the rtc.jar:

<plugin>
    <groupId>com.googlecode.maven-download-plugin</groupId>
    <artifactId>download-maven-plugin</artifactId>
    <version>${maven.download.plugin.version}</version>
    <executions>
        <execution>
            <id>get-mpa-rtc</id>
            <phase>validate</phase>
            <goals>
                <goal>wget</goal>
            </goals>
            <configuration>
                <url>http://www.mpa.ethz.ch/static/download.php?file=RTCToolbox_bin.zip</url>
                <unpack>true</unpack>
                <outputDirectory>${project.basedir}/lib/</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

For some file systems, in particular Windows ones (FAT and NTFS), the question mark ? is a reserved character. Unfortunately, the above code tries to save the zip file under the name download.php?file=RTCToolbox_bin.zip before unzipping and deleting it. This first step fails on some file systems like NTFS. For example, Maven will fail on Windows saying:

Caused by: java.io.FileNotFoundException: C:\Users\user_s_path\DNC\lib\download.php?file=RTCToolbox_bin.zip (The filename, directory name, or volume label syntax is incorrect)
    at java.base/java.io.FileOutputStream.open0(Native Method)
    at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:185)....

Workaround

1) Getting the dependency manually: For now, Windows users need to manually download the MPA RTC toolbox from http://www.mpa.ethz.ch/static/download.php?file=RTCToolbox_bin.zip and unzip it into the /lib directory. 2) Prevent Maven from trying to download: In the pom.xml, remove the above plugin from the mpa profile.


Thanks to Sidharth Sharma for reporting by email.

NetCal commented 2 years ago

The download URL changed, does not have a question mark in it anymore, so this issue is considered fixed.