[JBoss JIRA] (SHRINKRES-216) Add Ivy resolver
by Travis Schmidt (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-216?page=com.atlassian.jira.plu... ]
Travis Schmidt commented on SHRINKRES-216:
------------------------------------------
Great! Is this the best place to ask questions or would email or something else be better.
Travis
> 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, 1 month
[JBoss JIRA] (SHRINKRES-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Karel Piwko updated SHRINKRES-217:
----------------------------------
Fix Version/s: 2.2.0-cr-1
> 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.
> Fix For: 2.2.0-cr-1
>
>
> {{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 (more 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:
> {noformat}File localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));{noformat}
> use:
> {{File localResource = 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Karel Piwko commented on SHRINKRES-217:
---------------------------------------
[~famod] Nice catch. My reasoning for keeping the name more-or-less readable was to check the content of the file manually. I'd vote for using UUID, that seems like an easiest approach. Shame that Aether requires settings to be a file and you can't use stream, that would be the simplest option.
> 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.
> Fix For: 2.2.0-cr-1
>
>
> {{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 (more 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:
> {noformat}File localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));{noformat}
> use:
> {{File localResource = 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 Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-216?page=com.atlassian.jira.plu... ]
Karel Piwko commented on SHRINKRES-216:
---------------------------------------
Hi Travis,
I'm not aware of anybody working on Ivy support. But I can guide you through the process if you are willing to implement it!
Karel
> 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, 1 month
[JBoss JIRA] (SHRINKRES-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. updated SHRINKRES-217:
-------------------------------
Description:
{{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 (more 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:
{noformat}File localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));{noformat}
use:
{{File localResource = java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
was:
{{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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "\-").replace(File.pathSeparator, "\-").replaceAll("\\s", "-"));}}
use:
{{File localResource = java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
> 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 (more 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:
> {noformat}File localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));{noformat}
> use:
> {{File localResource = 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. updated SHRINKRES-217:
-------------------------------
Description:
{{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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));}}
use:
{{File localResource = java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
was:
{{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 (more 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.
> 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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));}}
> use:
> {{File localResource = 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. updated SHRINKRES-217:
-------------------------------
Description:
{{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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "\-").replace(File.pathSeparator, "\-").replaceAll("\\s", "-"));}}
use:
{{File localResource = java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
was:
{{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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "-").replace(File.pathSeparator, "-").replaceAll("\\s", "-"));}}
use:
{{File localResource = java.io.File.createTempFile(...)}}
which generates a file name that will most likely be "unique" for a certain time.
> 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 (more 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 localResource = new File(tmpDir, resourceName.replace("/", "-").replace("\\", "\-").replace(File.pathSeparator, "\-").replaceAll("\\s", "-"));}}
> use:
> {{File localResource = 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. edited comment on SHRINKRES-217 at 2/6/15 2:05 PM:
------------------------------------------------------------
Thinking about the approach in general, I am asking myself: Why can't you just use {{new File(url.toURI())}}(?)
Edit: Just forget this comment, I wasn't reading the source code properly.
was (Author: famod):
Thinking about the approach in general, I am asking myself: Why can't you just use {{new File(url.toURI())}}(?)
> 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 (more 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. updated SHRINKRES-217:
-------------------------------
Description:
{{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 (more 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.
was:
{{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.
> 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 (more 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-217) FileUtil.fileFromClassLoaderResource() creates non-unique temporary file
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-217?page=com.atlassian.jira.plu... ]
Falko M. commented on SHRINKRES-217:
------------------------------------
Thinking about the approach in general, I am asking myself: Why can't you just use {{new File(url.toURI())}}(?)
> 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