karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: karaf git commit: [KARAF-4931] - Static profile generation fails if configfile element contains a placeholder
Date Wed, 25 Jan 2017 14:15:23 GMT
Guillaume is currently fixing it.

Christian

On 25.01.2017 15:13, Achim Nierbeck wrote:
> That is rather strange, as I changed Karaf [1] for that prior fixing the
> corresponding issue at Pax Web [2].
>
> right now I don't have much time, so I'd need to check tonight. But it did
> work before, so was there another change to the Profiles?
>
> regards, Achim
>
> [1] - https://issues.apache.org/jira/browse/KARAF-4931
> [2] - https://ops4j1.jira.com/browse/PAXWEB-999
>
>
> 2017-01-25 14:56 GMT+01:00 Christian Schneider <chris@die-schneider.net>:
>
>> Hi Achim,
>>
>> the current karaf build fails at the demo of the static profile and at the
>> archetype assembly.
>> In both places the property replacement seems to be the cause.
>>
>> See the error below.
>>
>> Can you please check what is going on there?
>>
>> Christian
>>
>> [INFO] [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf
>> -maven-plugin:4.1.0-SNAPSHOT:assembly (default-assembly) on project
>> assembly: Unable to build assembly: Error downloading configuration files
>> -> [Help 1]
>> [INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
>> execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.0-SNAPSHOT:assembly
>> (default-assembly) on project assembly: Unable to build assembly
>> [INFO]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj
>> oExecutor.java:212)
>> [INFO]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj
>> oExecutor.java:153)
>> [INFO]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj
>> oExecutor.java:145)
>> [INFO]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.b
>> uildProject(LifecycleModuleBuilder.java:116)
>> [INFO]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.b
>> uildProject(LifecycleModuleBuilder.java:80)
>> [INFO]     at org.apache.maven.lifecycle.internal.builder.singlethreaded.S
>> ingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
>> [INFO]     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
>> (LifecycleStarter.java:128)
>> [INFO]     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:30
>> 7)
>> [INFO]     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:19
>> 3)
>> [INFO]     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
>> [INFO]     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
>> [INFO]     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
>> [INFO]     at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
>> [INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> [INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>> [INFO]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> [INFO]     at java.lang.reflect.Method.invoke(Method.java:498)
>> [INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnha
>> nced(Launcher.java:289)
>> [INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
>> Launcher.java:229)
>> [INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithEx
>> itCode(Launcher.java:415)
>> [INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.main(
>> Launcher.java:356)
>> [INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: Unable
>> to build assembly
>> [INFO]     at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.
>> java:268)
>> [INFO]     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMoj
>> o(DefaultBuildPluginManager.java:134)
>> [INFO]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj
>> oExecutor.java:207)
>> [INFO]     ... 20 more
>> [INFO] Caused by: java.io.IOException: Error downloading configuration
>> files
>> [INFO]     at org.apache.karaf.profile.assembly.AssemblyDeployCallback.ins
>> tallFeature(AssemblyDeployCallback.java:180)
>> [INFO]     at org.apache.karaf.features.internal.service.Deployer.deploy(
>> Deployer.java:823)
>> [INFO]     at org.apache.karaf.profile.assembly.Builder.resolve(Builder.
>> java:1392)
>> [INFO]     at org.apache.karaf.profile.assembly.Builder.startupStage(Build
>> er.java:1182)
>> [INFO]     at org.apache.karaf.profile.assembly.Builder.doGenerateAssembly
>> (Builder.java:658)
>> [INFO]     at org.apache.karaf.profile.assembly.Builder.generateAssembly(
>> Builder.java:440)
>> [INFO]     at org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo
>> .java:506)
>> [INFO]     at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.
>> java:262)
>> [INFO]     ... 22 more
>> [INFO] Caused by: org.apache.karaf.features.internal.util.MultiException:
>> Error
>> [INFO]     at org.apache.karaf.features.internal.download.impl.MavenDownlo
>> adManager$MavenDownloader.<init>(MavenDownloadManager.java:84)
>> [INFO]     at org.apache.karaf.profile.assembly.CustomDownloadManager$Cust
>> omMavenDownloader.<init>(CustomDownloadManager.java:58)
>> [INFO]     at org.apache.karaf.profile.assembly.CustomDownloadManager.crea
>> teDownloader(CustomDownloadManager.java:55)
>> [INFO]     at org.apache.karaf.profile.assembly.AssemblyDeployCallback.ins
>> tallFeature(AssemblyDeployCallback.java:148)
>> [INFO]     ... 29 more
>> [INFO]     Suppressed: java.nio.file.NoSuchFileException:
>> /home/cschneider/checkout/karaf/archetypes/assembly/target/
>> test-classes/projects/assembly/project/assembly/target/
>> assembly/${karaf.etc}/jetty.xml
>>
>>
>>
>> On 12.01.2017 19:52, anierbeck@apache.org wrote:
>>
>>> Repository: karaf
>>> Updated Branches:
>>>     refs/heads/master 715d236f5 -> e6e0928b9
>>>
>>>
>>> [KARAF-4931] - Static profile generation fails if configfile element
>>> contains a placeholder
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/e6e0928b
>>> Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/e6e0928b
>>> Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/e6e0928b
>>>
>>> Branch: refs/heads/master
>>> Commit: e6e0928b99675a2735a9c3b8927e93520ff32eac
>>> Parents: 715d236
>>> Author: anierbeck <bcanhome@googlemail.com>
>>> Authored: Thu Jan 12 18:51:28 2017 +0000
>>> Committer: anierbeck <bcanhome@googlemail.com>
>>> Committed: Thu Jan 12 18:51:28 2017 +0000
>>>
>>> ----------------------------------------------------------------------
>>>    .../assembly/AssemblyDeployCallback.java        | 21
>>> +++++++++++++++++++-
>>>    1 file changed, 20 insertions(+), 1 deletion(-)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/karaf/blob/e6e0928b/p
>>> rofile/src/main/java/org/apache/karaf/profile/assembly/Assem
>>> blyDeployCallback.java
>>> ----------------------------------------------------------------------
>>> diff --git a/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
>>> b/profile/src/main/java/org/apache/karaf/profile/assembly/As
>>> semblyDeployCallback.java
>>> index 2c4a09b..f86b682 100644
>>> --- a/profile/src/main/java/org/apache/karaf/profile/assembly/As
>>> semblyDeployCallback.java
>>> +++ b/profile/src/main/java/org/apache/karaf/profile/assembly/As
>>> semblyDeployCallback.java
>>> @@ -151,7 +151,7 @@ public class AssemblyDeployCallback implements
>>> Deployer.DeployCallback {
>>>                    @Override
>>>                    public void downloaded(StreamProvider provider) throws
>>> Exception {
>>>                        Path input = provider.getFile().toPath();
>>> -                    String path = configFile.getFinalname();
>>> +                    String path = substFinalName(configFile.getF
>>> inalname());
>>>                        if (path.startsWith("/")) {
>>>                            path = path.substring(1);
>>>                        }
>>> @@ -266,4 +266,23 @@ public class AssemblyDeployCallback implements
>>> Deployer.DeployCallback {
>>>        @Override
>>>        public void replaceDigraph(Map<String, Map<String, Map<String,
>>> Set<String>>>> policies, Map<String, Set<Long>> bundles)
throws
>>> BundleException, InvalidSyntaxException {
>>>        }
>>> +
>>> +    private String substFinalName(String finalname) {
>>> +        final String markerVarBeg = "${";
>>> +        final String markerVarEnd = "}";
>>> +
>>> +        boolean startsWithVariable = finalname.startsWith(markerVarBeg)
>>> && finalname.contains(markerVarEnd);
>>> +        if (startsWithVariable) {
>>> +            String marker = finalname.substring(markerVarBeg.length(),
>>> finalname.indexOf(markerVarEnd) - 1);
>>> +            switch (marker) {
>>> +            case "karaf.base":
>>> +                return this.homeDirectory + "/" +
>>> finalname.substring(finalname.indexOf(markerVarEnd)+markerVa
>>> rEnd.length());
>>> +            case "karaf.etc":
>>> +                return this.etcDirectory + "/" +
>>> finalname.substring(finalname.indexOf(markerVarEnd)+markerVa
>>> rEnd.length());
>>> +            default:
>>> +                break;
>>> +            }
>>> +        }
>>> +        return finalname;
>>> +    }
>>>    }
>>>
>>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Mime
View raw message