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 13:56:49 GMT
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(MojoExecutor.java:212)
[INFO]     at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO]     at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO]     at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[INFO]     at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[INFO]     at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.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:307)
[INFO]     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[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(NativeMethodAccessorImpl.java:62)
[INFO]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]     at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]     at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO]     at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO]     at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(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.executeMojo(DefaultBuildPluginManager.java:134)
[INFO]     at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[INFO]     ... 20 more
[INFO] Caused by: java.io.IOException: Error downloading configuration files
[INFO]     at 
org.apache.karaf.profile.assembly.AssemblyDeployCallback.installFeature(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(Builder.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.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)
[INFO]     at 
org.apache.karaf.profile.assembly.CustomDownloadManager$CustomMavenDownloader.<init>(CustomDownloadManager.java:58)
[INFO]     at 
org.apache.karaf.profile.assembly.CustomDownloadManager.createDownloader(CustomDownloadManager.java:55)
[INFO]     at 
org.apache.karaf.profile.assembly.AssemblyDeployCallback.installFeature(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/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.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/AssemblyDeployCallback.java
> index 2c4a09b..f86b682 100644
> --- a/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
> +++ b/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.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.getFinalname());
>                       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)+markerVarEnd.length());
> +            case "karaf.etc":
> +                return this.etcDirectory + "/" + finalname.substring(finalname.indexOf(markerVarEnd)+markerVarEnd.length());
> +            default:
> +                break;
> +            }
> +        }
> +        return finalname;
> +    }
>   }
>


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

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


Mime
View raw message