[JBoss JIRA] (SHRINKRES-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
Falko M. created SHRINKRES-217:
----------------------------------
Summary: FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
Key: SHRINKRES-217
URL: https://issues.jboss.org/browse/SHRINKRES-217
Project: ShrinkWrap Resolvers
Issue Type: Bug
Components: maven
Affects Versions: 2.0.2
Reporter: Falko M.
{{org.jboss.shrinkwrap.resolver.impl.maven.util.FileUtil}} copies a classpath file to the system temp directory (defined by {{java.io.tmpdir}}) to be able to work with it as a plain file.
The problem is that the file name is used *as is*.
Now imagine multiple maven-surefire processes running Tests using the same classpath resource. They all and up trying to write a file with the same name in a (mor or less) global temporary directory.
Because of this we have seen multiple build failures on or Jenkins CI machine which uses {{-T...}} and {{-DforkCount=...}} liberally like this one:
{noformat}Caused by: org.jboss.shrinkwrap.resolver.api.InvalidConfigurationFileException: Found 1 problems while building POM model from /tmp/someproject-main-continuous-1.1.1/META-INF-maven-com.somecompany.someproject-middleware-common-test-pom.xml
1/ [FATAL] Non-readable POM /tmp/someproject-main-continuous-1.1.1/META-INF-maven-com.somecompany.someproject-middleware-common-test-pom.xml: no more data available - expected end tags </version></dependency></dependencies></project> to close start tag <version> from line 75 and start tag <dependency> from line 77 and start tag <dependencies> from line 48 and start tag <project> from line 2, parser stopped on TEXT seen ...<dependency>\n <gro... @78:17 @ /tmp/someproject-main-continuous-1.1.1/META-INF-maven-com.somecompany.someproject-middleware-common-test-pom.xml{noformat}
Solution:
Instead of:
{{File tmpDir = new File(SecurityActions.getProperty("java.io.tmpdir"));}}
use:
{{java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (SHRINKRES-216) Add Ivy resolver
by Travis Schmidt (JIRA)
Travis Schmidt created SHRINKRES-216:
----------------------------------------
Summary: Add Ivy resolver
Key: SHRINKRES-216
URL: https://issues.jboss.org/browse/SHRINKRES-216
Project: ShrinkWrap Resolvers
Issue Type: Enhancement
Components: api
Reporter: Travis Schmidt
Priority: Optional
Add Ivy resolver that can take ivysettings.xml and use the local ivy repository to resolve dependencies.
For projects that use Ant+Ivy for dependency management it would be useful to be able to use the project specific ivysettings.xml and the local Ivy repository that is already populated. My understanding is that using the Maven resolver will result in a new local .m2 repository to be created that is only used for Arquillian test. Adding custom repository requires creating a Maven settings.xml that is also only used for Arquillian testing.
Is anyone currently working on a feature that can address these issues? I am willing to try and take a crack at it if I can get some support and guidance from project contributors.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 2 months