I am trying to build a custom distribution by adding eventadmin and scr features to startup features.
I have tried the following based on the official documentation at http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html.
I have created a new project with the following pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jemz.jf.karaf</groupId>
<artifactId>jf-framework-karaf</artifactId>
<packaging>karaf-assembly</packaging>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>framework</artifactId>
<version>4.0.4</version>
<type>kar</type>
</dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>standard</artifactId>
<version>4.0.4</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>4.0.4</version>
<extensions>true</extensions>
<configuration>
<!-- no startupFeatures -->
<startupFeatures>
<feature>eventadmin</feature>
<feature>scr</feature>
</startupFeatures>
<installedFeatures>
</installedFeatures>
<bootFeatures>
<feature>standard</feature>
</bootFeatures>
<excludedArtifactIds>
<artifactId>slf4j-api</artifactId>
</excludedArtifactIds>
</configuration>
</plugin>
</plugins>
</build>
Unfortunately when I run 'mvn install' it fails with:
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.4:assembly (default-assembly) on project jf-framework-karaf: Unable to build assembly: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=scr; type=karaf.feature; filter:="(&(osgi.identity=scr)(type=karaf.feature))" -> [Help 1]
If I move the 'eventadmin'and 'scr' features to 'bootFeatures', although that is not what I originally wanted, the custom karaf distribution is assembled ok, but when I started it returns some exceptions as shown below:
jmartinez#archlinux-dev-64 target]$ ./jf-framework-karaf-3.0.0-SNAPSHOT/bin/karaf
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.0.4)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf#root()> org.apache.karaf.features.core[org.apache.karaf.features.internal.service.BootFeaturesInstaller] : Error installing boot features
org.apache.karaf.features.internal.util.MultiException: Error restarting bundles
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:848)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1089)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:985)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Suppressed: org.osgi.framework.BundleException: Activator start error in bundle org.ops4j.pax.url.wrap [55].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1199)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:840)
... 6 more
Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:482)
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:474)
at java.net.URL.toExternalForm(URL.java:922)
at java.net.URL.toString(URL.java:908)
at java.lang.ClassLoader.defineClassSourceLocation(ClassLoader.java:675)
at java.lang.ClassLoader.defineClass(ClassLoader.java:759)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1415)
at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4468)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2221)
... 11 more
Suppressed: org.osgi.framework.BundleException: Activator start error in bundle org.apache.felix.metatype [21].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1199)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:840)
... 6 more
Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:482)
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:474)
at java.net.URL.toExternalForm(URL.java:922)
at java.net.URL.toString(URL.java:908)
at java.lang.ClassLoader.defineClassSourceLocation(ClassLoader.java:675)
at java.lang.ClassLoader.defineClass(ClassLoader.java:759)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1415)
at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4468)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2221)
... 11 more
Suppressed: org.osgi.framework.BundleException: Activator start error in bundle org.apache.karaf.services.eventadmin [45].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1199)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:840)
... 6 more
Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:482)
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:474)
at java.net.URL.toExternalForm(URL.java:922)
at java.net.URL.toString(URL.java:908)
at java.lang.ClassLoader.defineClassSourceLocation(ClassLoader.java:675)
at java.lang.ClassLoader.defineClass(ClassLoader.java:759)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1415)
at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4468)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2221)
... 11 more
The specified feature: 'standard' version '4.0.4' is already installed
The specified feature: 'scr' version '4.0.4' is already installed
The specified feature: 'eventadmin' version '4.0.4' is already installed
^C
karaf#root()> ^Dkaraf#root()>
Eventhough everything is installed and started ok. After a reboot all exceptions disappear and works fine.
My questions are:
How can I make a custom distribution where eventadmin and scr
features are started on boot (startup.properties)?
How can I get rid of those exceptions on the first boot when eventadmin/scr features are set on bootFeatures?
As a side note I have been able to set a stable custom distribution as I want using the deprecated old style of Maven assembly, but It seems by far more ease to use the new way with karaf-maven-plugin.
Remove the runtime scope from the Karaf standard feature :
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>standard</artifactId>
<version>4.0.4</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
this scope prevent some bundle, needed by eventadmin/scr, to be added to the startup stage. tbh, i don't clearly understand all the facet of the resolver used here with the different stage and profile to generate an assembly, but removing this scope make it work
Related
I've been trying to include the alfresco-simple-content-stores library (https://github.com/Acosix/alfresco-simple-content-stores) with Alfresco Community Edition, and it doesn't appear to be working. I've followed the documentation as best as I can, but I think I must be missing a step because my configuration appears to be completely ignored and there is no indication that it is running. I've done the following:
First, following this documentation (https://docs.alfresco.com/community/tasks/amp-install.html) I tried installing the amp using Alfresco mmt. That failed with the following message:
10250001 An error was encountered during deployment of the AMP into the WAR: 10250000 The following modules must first be installed: [acosix-utility-core:1.0.3.1-*]
However, no such artifact seems to exist.
As I couldn't get past that speed bump, I went down the following path:
I generated a keystore and a master key, referenced below in step 4
I included the following dependency in my alfresco/war/pom.xml (1.0.1.TEST is my locally compiled version of alfresco-simple-content-stores)
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.TEST</version>
<type>amp</type>
</dependency>
I copied the artifact to the Tomcat directory in my Dockerfile
COPY ./war/target/de.acosix.alfresco.simplecontentstores.repo-1.0.1.TEST.amp ${TOMCAT_DIR}/amps
I defined the following properties in my alfresco-global.properties
simpleContentStores.enabled=true
simpleContentStores.customStores=myEncryptingStore,defaultTenantFileContentStore
simpleContentStores.rootStore=myEncryptingStore
simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore
simpleContentStores.customStore.myEncryptingStore.ref.backingStore=defaultTenantFileContentStore
simpleContentStores.customStore.myEncryptingStore.value.keyStorePath=classpath:../keystore/keystore.jks
simpleContentStores.customStore.myEncryptingStore.value.keyStorePassword=masterkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyAlias=ssl
simpleContentStores.customStore.myEncryptingStore.value.masterKeyPassword=alfkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyStoreId=alfkeystore
Despite all of this, files continue to be stored unencrypted and I see no indication that anything has failed. I doubt that this library would fail silently, so I'm left to assume that I've missed some step required to make Alfresco use this plugin.
Any ideas?
Edit:
In response to a comment, here is the abbreviated pom of my alfresco/war project:
<dependencies>
...
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.PST</version>
<type>amp</type>
</dependency>
...
</dependencies>
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay />
<overlay>
<groupId>${alfresco.groupId}</groupId>
<artifactId>${alfresco.share.artifactId}</artifactId>
<type>war</type>
<excludes />
</overlay>
<!-- other AMPs -->
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<type>amp</type>
</overlay>
</overlays>
</configuration>
</plugin>
...
</plugins>
...
</build>
Now with that pom configuration, the maven install output shows as follows (shortened to hide irrelevant path information):
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.repo/1.0.2.1/de.acosix.alfresco.utility.repo-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.share]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.share/1.0.2.1/de.acosix.alfresco.utility.share-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.simplecontentstores:de.acosix.alfresco.simplecontentstores.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/simplecontentstores/de.acosix.alfresco.simplecontentstores.repo/1.0.1.PST/de.acosix.alfresco.simplecontentstores.repo-1.0.1.PST.amp with unknown extension [amp]
when i'm running the grpc client i'm getting the following error.my grpc-server is working well ....................................................................................................................................................
mvn exec:java -Dexec.mainClass="com.example.grpc.client.MyGrpcClient.java" -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 14.04
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[WARNING] Failed to inject repository session properties.
java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/eclipse/aether/RepositorySystemSession;
at kr.motd.maven.os.RepositorySessionInjector.injectRepositorySession(RepositorySessionInjector.java:22)
at kr.motd.maven.os.DetectExtension.injectSession(DetectExtension.java:148)
at kr.motd.maven.os.DetectExtension.afterProjectsRead(DetectExtension.java:107)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:497)
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)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building simple-grpc-client 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) # simple-grpc-client ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.591s
[INFO] Finished at: Wed Mar 01 14:50:54 IST 2017
[INFO] Final Memory: 10M/212M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project simple-grpc-client: Execution default-cli of goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java failed: Invalid classpath scope: tuomas -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project simple-grpc-client: Execution default-cli of goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java failed: Invalid classpath scope: tuomas
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:497)
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 default-cli of goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java failed: Invalid classpath scope: tuomas
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.IllegalStateException: Invalid classpath scope: tuomas
at org.codehaus.mojo.exec.AbstractExecMojo.collectProjectArtifactsAndClasspath(AbstractExecMojo.java:118)
at org.codehaus.mojo.exec.ExecJavaMojo.addRelevantProjectDependenciesToClasspath(ExecJavaMojo.java:607)
at org.codehaus.mojo.exec.ExecJavaMojo.getClassLoader(ExecJavaMojo.java:528)
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:308)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecution
I am using maven here.I will be much appreciated if you can help me............
here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Google, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>grpc-demos</artifactId>
<groupId>com.example</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>simple-grpc-client</artifactId>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>simple-grpc-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.1.5</version>
</dependency>
</dependencies>
</project>
it is taking dependencies from server. i changed it as follows to get dependencies by its own.
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Google, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>grpc-demos</artifactId>
<groupId>com.example</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>simple-grpc-client</artifactId>
<dependencies>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<!--
The version of protoc must match protobuf-java. If you don't depend on
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
well.i've just figured out the problem you have.
i select my maven version from nested one 3.05 to 3.39,and it work out properly.
pay attention,even if you got 3.39 in your terminal when you writemvn --version,it doesn't mean that you are using mvn 3.39,you should set it in your settings,and then you are really using maven of a version 3.39.
I'm migrating an application I had working with Adobe Flex 4.6 and FlexMojos 4 to Apache Flex 4.14 and FlexMojos 7. When I try to execute "mvn build" I'm getting this error:
[ERROR] Unresolveable build extension: Plugin net.flexmojos.oss:flexmojos-maven-plugin:7.0.1 or one of its dependencies could not be resolved:
The following artifacts could not be resolved:
org.apache.flex.compiler:mxmlc:jar:4.12.1.20140427,
org.apache.flex.compiler:digest:jar:4.12.1.20140427,
org.apache.flex.compiler:optimizer:jar:4.12.1.20140427,
org.apache.flex.compiler:asdoc:jar:4.12.1.20140427,
org.apache.flex.compiler:swcdepends:jar:4.12.1.20140427,
org.apache.flex:compiler:pom:4.12.1.20140427: Failure to find
org.apache.flex.compiler:mxmlc:jar:4.12.1.20140427 in
http://repository.sonatype.org/content/groups/flexgroup/ was cached in the local repository, resolution will not be reattempted until the update interval of flex-mojos-repository has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: swf # line 5, column 13
This is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cognifit.cognifitSocialFlex</groupId>
<artifactId>FlexCognifit</artifactId>
<packaging>swf</packaging>
<name>cognifitSocialFlex</name>
<version>11.0.2.10</version>
<properties>
<flex.version>4.14.1.20150325</flex.version>
<flashplayer.version>11.1</flashplayer.version>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<directory>${project.basedir}/target/${project.version}</directory>
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>7.0.1</version>
<extensions>true</extensions>
<configuration>
<sourceFile>CpcSocialFlex.mxml</sourceFile>
<swfVersion>13</swfVersion>
<targetPlayer>11.1.0</targetPlayer>
<localesCompiled>
<locale>ar_MA</locale>
<locale>de_AT</locale>
<locale>de_CH</locale>
<locale>de_DE</locale>
<locale>el_GR</locale>
<locale>en_US</locale>
<locale>en_ZA</locale>
<locale>es_ES</locale>
<locale>es_MX</locale>
<locale>fr_FR</locale>
<locale>he_IL</locale>
<locale>it_IT</locale>
<locale>ja_JP</locale>
<locale>ko_KR</locale>
<locale>nl_NL</locale>
<locale>pt_BR</locale>
<locale>pt_PT</locale>
<locale>ru_RU</locale>
<locale>sr_RS</locale>
<locale>tr_TR</locale>
<locale>zh_CN</locale>
<locale>zh_HK</locale>
</localesCompiled>
<dependencies>
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.flex</groupId>
<artifactId>framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flash.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flashplayer.version}</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework.themes</groupId>
<artifactId>halo</artifactId>
<type>swc</type>
<scope>theme</scope>
<version>${flex.version}</version>
</dependency>
</dependencies>
</project>
I'm using Maven 3.2.5 and Java 1.6.0_14:
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T12:29:23-05:00)
Maven home: /usr/local/maven
Java version: 1.6.0_14, vendor: Sun Microsystems Inc.
Java home: /usr/java/jdk1.6.0_14/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.21.7-2.fc8xen", arch: "i386", family: "unix"
These are the steps I have followed:
I downloaded the Apache Flex SDK with the Installer:
Apache Flex SDK 4.14.1
AIR 18.0
Flash Player 18
I have used the Mavenizer to create a Maven version of this SDK:
Then I have deployed the mavenized version in my /root/.m2/repository/ folder and executed mvn compile with the pom.xml.
By the way in the meanwhile the mavenizer has evolved quite a bit ... making usage of maven extensions by ".mvn/extensions.xml" files. This should automatically download, convert and install the Flex/Flash/Air resources you reference. So to upgrade to the next Flex/Flash/Air version, just reference a new version and the plugin will take care of the rest (As long as the version actually exists). See more details here: https://cwiki.apache.org/confluence/display/FLEX/Preparing+FDKs+for+Maven+builds (Pay some special attention to the chapter: Prepare the FDK resources using the flex-sdk-converter-maven-extension)
I am trying to configure the development environment for Alfresco version 5.0.b.
i have tried as per the documentation for maven and also tried by my way in eclipse but i am facing an issue with both like
if i do it by maven from command prompt like
C:\maven_projects\project_1>mvn install
[INFO] Scanning for
projects... Downloading:
https ://repo.maven.apache.org/maven2/org/alfresco/maven/alfresco-sd
k-parent/2.0.0-beta-4/alfresco-sdk-parent-2.0.0-beta-4.pom [ERROR] The
build could not read 1 project -> [Help 1] [ERROR] [ERROR] The
project ipr.res.in:project_1:1.0-SNAPSHOT (C:\maven_projects\proje
ct_1\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Could
not transfer artifact org.alfresco.
maven:alfresco-sdk-parent:pom:2.0.0-beta-4 from/to central
(https: //repo.maven.a pache.org/maven2): repo.maven.apache.org and
'parent.relativePath' points at wro ng local POM # line 12, column 13:
Unknown host repo.maven.apache.org -> [Help 2 ] [ERROR] [ERROR] To see
the full stack trace of the errors, re-run Maven with the -e swit ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible
solutions, please rea d the following articles: [ERROR] [Help 1]
http: //cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException [ERROR] [Help 2]
http: //cwiki.apache.org /confluence/display/MAVEN/UnresolvableMo
delException C:\maven_projects\project_1>
If i try in eclipse
i create one project as maven project in that i add the catalog file with maven central for the url (http: //repo1.maven.org/maven2/archetype-catalog.xml) but when i try to import the archetype (org.alfresco. ..) it is not giving me anything.
So kindly help me out for the issue to configure the AMP
My Project POM.XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http: //maven.apache.org/POM/4.0.0" xmlns:xsi="http: //www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http: //maven.apache.org/POM/4.0.0 http: //maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alfresco.tutorials</groupId>
<artifactId>quick-start-project</artifactId>
<version>1.0-SNAPSHOT</version>
<name>quick-start-project Repository AMP project</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the quick-start-project Repository AMP (Alfresco Module Package)</description>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>2.0.0-beta-4</version>
</parent>
<!--
| SDK properties have sensible defaults in the SDK parent,
| but you can override the properties below to use another version.
| For more available properties see the alfresco-sdk-parent POM.
-->
<properties>
<!--
| Defines the groupId for the Alfresco Artifacts to work against. As of 4.2 the only allowed value is: org.alfresco
| NOTE: See http: //docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-tutorials-alfresco-enterprise.html for details
-->
<alfresco.groupId>org.alfresco</alfresco.groupId>
<!-- Defines the Alfresco version to work against.
Community versions are typically identified by major.minor.character (4.2.a) while Enterprise versions are identified by major.minor.digit (4.2.0) -->
<alfresco.version>5.0.a</alfresco.version>
<app.log.root.level>WARN</app.log.root.level>
<alfresco.data.location>alf_data_dev</alfresco.data.location>
<!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war switch
. | Allowed values: alfresco | share. Defaults to a repository AMP, but could point to your foundation WAR -->
<alfresco.client.war>alfresco</alfresco.client.war>
<!-- Defines the target WAR groupId to run this amp, only used with the -Pamp-to-war switch
. | Could be org.alfresco or your corporate groupId -->
<alfresco.client.war.groupId>org.alfresco</alfresco.client.war.groupId>
<!-- Defines the target WAR version to run this amp, only used with the -Pamp-to-war switch -->
<alfresco.client.war.version>5.0.a</alfresco.client.war.version>
<!-- This controls which properties will be picked in src/test/properties for embedded run -->
<env>local</env>
</properties>
<!-- Here we realize the connection with the Alfresco selected platform
(e.g.version and edition) -->
<dependencyManagement>
<dependencies>
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco version/edition
(see http: //maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies)
NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement. NOTE: It defaults
to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
<version>${alfresco.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Following dependencies are needed for compiling Java code in src/main/java;
<scope>provided</scope> is inherited for each of the following;
for more info, please refer to alfresco-platform-distribution POM -->
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
</dependency>
</dependencies>
</project>
As the Maven error message explains, the Alfresco Maven SDK is not available in Maven central. It is only available from the Alfresco Artifacts Maven repository
You therefore need to add this snippet into your pom:
<repositories>
<repository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
</repositories>
You can find out more from the Alfresco Maven SDK wiki page and the Alfresco Artifacts Maven Repository wiki page
I'm currently developping an flex application, and i've used native cursor support to dynamically change cursor in particular conditions.
My application runs with Flex Sdk 4.1.0.16076, which use flash player 10.0 by default.
I have upgrade this version to 10.2 in project preferences, in order to use MouseCursorData class.
It works fine in eclipse but i'm using maven for dependencies and I have compilation error when doing a maven build, saying MouseCursorData Class can't be found.
It's pretty normal since i'm using player 10 in my dependencies. So I tried to update my pom.xml file for upgrading player to 10.2 :
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<configuration>
<targetPlayer>10.0</targetPlayer>
<compiledLocales>
<locale>en_US</locale>
<locale>fr_FR</locale>
</compiledLocales>
<warnings>
<noConstructor>false</noConstructor>
</warnings>
<sourceFile>Opale.mxml</sourceFile>
<generateHtmlWrapper>true</generateHtmlWrapper>
<contextRoot>opale-web</contextRoot>
<services>${basedir}/src/main/resources/services-config.xml</services>
<output>target/opale-ui.swf</output>
</configuration>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
First, I have changed the targetPlayer in flex mojo plugin from 10.0 to 10.2.
Then I obtain the compilation error :
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf (default-compile-swf) on project opale-ui: TargetPlayer and playerglobal dependency version doesn't match! Target player: 10.2, player global: 10.0 -> [Help 1]
So, i had a dependency to force playerglobal version :
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flex.sdk.version}</version>
<classifier>10.2.0</classifier>
<type>swc</type>
</dependency>
Then, i have the following error :
Downloading: http://repo.maven.apache.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.698s
[INFO] Finished at: Wed Sep 12 12:29:57 CEST 2012
[INFO] Final Memory: 9M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project opale-ui: Could not resolve dependencies for project com.igc.opale:opale-ui:swf:1.9-SNAPSHOT: Could not transfer artifact com.adobe.flex.framework:playerglobal:swc:10.2.0:4.1.0.16076 from/to jboss (http://repository.jboss.org/maven2/): Access denied to: http://repository.jboss.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc, ReasonPhrase:Forbidden. -> [Help 1]
I new to maven so maybe i'm doing this pretty badly.
You can configure this in plugins
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<headlessServer>true</headlessServer>
<verboseStacktraces>true</verboseStacktraces>
<swfVersion>11</swfVersion>
<targetPlayer>10.2</targetPlayer>
...
</configuration>
</plugin>
</plugins>
And dependency:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.5.1.21328</version>
<classifier>10.2</classifier>
<type>swc</type>
</dependency>
If you search the sonatype repo you will find that the actual dependency you are looking for is:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.1.0.16076</version>
<classifier>10</classifier>
<type>1.swc</type>
</dependency>
notice how the type is 1.swc, I believe this is to cater for a shortfall in earlier versions of the SDK.