[maven] using an url as file does not work on windows.
See original GitHub issue- using an url as file does not work on windows.
- [ maven 3.2.4 ] gradle or maven version
- [1.0.0.BETA4 ] spotless version
- [ windows 10 - 1709] operating system and version
<configuration>
<java>
<eclipse>
<file>https://git.mycompany.de/projects/INFRA/repos/pm-codestyle/raw/eclipse-java-pm-style.xml</file>
<version>4.7.1</version>
</eclipse>
</java>
</configuration>
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:1.0.0.BETA4:apply (code-formatting) on project project-api: Execution code-formatting of goal com.diffplug.spotless:spotless-maven-plugin:1.0.0.BETA4:apply failed: Unable to create tem
poraty file 'https://git.mycompany.de/projects/INFRA/repos/pm-codestyle/raw/eclipse-java-pm-style-1527576190601.xml' in the output directory: Failed to create directory D:\git\project\api\target\https:\git.mycompany.de\projects\INFRA\repos\pm-codestyle\raw -> [
Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:1.0.0.BETA4:apply (code-formatting) on project project-api: Execution code-formatting of goal com.diffplug.spotless:spotless-maven-plugi
n:1.0.0.BETA4:apply failed: Unable to create temporaty file 'https://git.mycompany.de/projects/INFRA/repos/pm-codestyle/raw/eclipse-java-pm-style-1527576190601.xml' in the output directory
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution code-formatting of goal com.diffplug.spotless:spotless-maven-plugin:1.0.0.BETA4:apply failed: Unable to create temporaty file 'https://git.mycompany.de/projects/INFRA/repos/pm-codestyle/raw/ec
lipse-java-pm-style-1527576190601.xml' in the output directory
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.RuntimeException: Unable to create temporaty file 'https://git.mycompany.de/projects/INFRA/repos/pm-codestyle/raw/eclipse-java-pm-style-1527576190601.xml' in the output directory
at com.diffplug.spotless.maven.FileLocator.locateFile(FileLocator.java:46)
at com.diffplug.spotless.maven.java.Eclipse.newFormatterStep(Eclipse.java:41)
at com.diffplug.spotless.maven.FormatterFactory.lambda$newFormatter$1(FormatterFactory.java:74)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.diffplug.spotless.maven.FormatterFactory.newFormatter(FormatterFactory.java:75)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute(AbstractSpotlessMojo.java:101)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute(AbstractSpotlessMojo.java:95)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
Caused by: org.codehaus.plexus.resource.loader.FileResourceCreationException: Failed to create directory D:\git\project\api\target\https:\git.mycompany.de\projects\INFRA\repos\pm-codestyle\raw
at org.codehaus.plexus.resource.DefaultResourceManager.createResourceAsFile(DefaultResourceManager.java:209)
at org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:101)
at com.diffplug.spotless.maven.FileLocator.locateFile(FileLocator.java:42)
... 34 more
So, i guess the problem is the colon “:” as well as the slashes “/” as they do not work on windows.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
On Windows, Maven requires local distribution repository URL ...
On Windows, Maven requires local distribution repository URL be specified as invalid file URL with Windows path. Status: Assignee: Priority:.
Read more >Karaf service on Windows does not allow install with a mvn url ...
it fails to find the bundle in the local repository. However I am able to install with a file url . I suspected...
Read more >Using Windows path or URL in querydsl-maven-plugin jdbcUrl ...
I'm using querydsl-maven-plugin on Windows and there's apparently no feasible way to specify a Windows file path in the JDBC URL settings.
Read more >IntelliJ IDEA - Troubleshooting common Maven issues
If you encounter problems working with your Maven project you can check to see if the following solutions and workarounds can help you...
Read more >How to install Maven on Windows - Mkyong.com
To install Apache Maven on Windows, you just need to download the Maven's zip file, unzip it to a folder, and configure the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is downloading it every time and this is 100% acceptable. But the temp file has the same name as the given url. This simply does not work on windows machines. If you trim the temp file name to the stuff following the last slash it should work fine.
Fixed in
1.13.0
.