Alfresco Configuration to Eclipse or by Maven - alfresco

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

Related

Maven Dependencies Jar Missing for Slf4j wrapper

I have a project in Maven for ExtentReports. When I run it, the test fail and says.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
When I check the project properties -> java build path -> libraries. ->Maven Dependencies
rxjava-3.0.4.jar (missing)
freemarker-2.3.30.jar (missing)
lombok-1.18.12.jar (missing)
when I go to POM.xml
4.0.0
it says:
could not transfer artifact io.reactivex.rxjava3:rxjava:jar3.0.4
I tried downloading the said jars in mvn repository but it doesnt make any changes.
SLF4j wrapper is generally provided by Lombok.
I recommend you put these dependencies in your pom.xml:
You need the SLF4j wrapper AS WELL AS a dependency for which implementation you want to use. (Logback in this case).
<!--region Lombok Configuration -->
<!-- logger guide https://gist.github.com/stykalin/8c77ad2a705eabddc2424eff0e99d1ec -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
</dependency>
<!-- endregion -->
Also, you will need to setup a src/main/resources/logback.xml file. Also, put #Slf4j Lombok annotation at the top of your class files where you need to do a log.info("Message").
IF you still have problems, the command mvn dependency:tree can perhaps help you find dependency conflicts.

How do I get Alfresco to use the alfresco-simple-content-stores plugin?

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]

Karaf 4.0.4: Custom distribution - karaf-maven-plugin

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

m2e-webby and provided dependencies with jetty

I have a maven project with some provided dependencies and I am trying to run the application with webby but it give me a java.lang.ClassNotFoundException exception.
In this link it says: "Webby allows to initialize a launch configuration from the configuration of the jetty-maven-plugin".
My question is it is possible to also pass the dependencies defined in the jetty-maven-plugin? If not how can webby resolve the provided dependencies?
Want I did was to create a profile in the pom project:
<profile>
<id>webby</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>version</version>
</dependency>
</dependencies>
</profile>
And then right click on the project -> properties -> Maven and added webby to the Active Maven Profiles

Sonar Analysis for website project - ASP.NET

I was trying to build and analyze a asp.net website project using maven
Command I used :
mvn sonar:sonar -e
I have single pom file in my root directory(same directory where website.sln is stored).
Directory structure:
|---Website (website project file)
|
|---website.sln
|---pom.xml
|
Result of executing command was : Build Error -Embedded error: Unable to execute maven plugin
I did same things and I could successfully build a web application project and console application project(which have visual studio project file). I thing reason for not working for website project is it does not have .csproj file inside website folder.
So how could successfully build and analyze a website project using maven.
Could someone please help me to fix this issue.
this is my pom file:
http://maven.apache.org/maven-v4_0_0.xsd">
<groupId>MindTree</groupId>
<artifactId>webbssite</artifactId>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<name>Maya</name>
<packaging>sln</packaging>
<url>http://maven.apache.org</url>
<properties>
<!--
NOTE : the versions and parameters may be defined as properties.
Prefer this option to the plugin configuration as it may be accessible to several plugins
-->
<!-- Name of the solution file, located in the same directory as the pom.xml -->
<visual.studio.solution>website.sln</visual.studio.solution>
<!-- Name pattern to recognize the test assemblies, so that unit tests are only launched on those,
and so that those are excluded from code coverage -->
<visual.test.project.pattern>*.Tests</visual.test.project.pattern>
<!-- Version of the .Net tools, which may be 2.0 or 3.5 only -->
<dotnet.tool.version>4.0</dotnet.tool.version>
<sonar.language>cs</sonar.language>
<msbuild.configurations>Debug</msbuild.configurations>
<maven.site.generateReports>false</maven.site.generateReports>
<sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
<sonar.cpd.skip>true</sonar.cpd.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.sonar-plugins.dotnet</groupId>
<artifactId>maven-dotnet-plugin</artifactId>
<version>0.6</version>
<configuration>
<solutionName>website.sln</solutionName>
<language>cs</language>
<toolVersion>3.5</toolVersion>
<Platform>x86</Platform>
<buildConfigurations>Release,Debug</buildConfigurations>
<rebuild>true</rebuild>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
You should rather send a mail to the user mailing list.
Anyway I have the feeling there is a misunderstanding between the "maven dotnet plugin" and the "sonar maven plugin".
The "maven dotnet plugin" provides the ability to build dotnet visual studio solution with maven. It relies mostly on msbuild.
The "sonar maven dotnet plugin" alows to bootstrap a sonar analysis with maven.
Check out the second pom example on the following page : Maven .NET Plugin
Both plugins need to be configured if you want to use maven to build and analyse your solution.
That being said, you should know that neither maven nor those two plugins are mandatory to analyse a C# project with sonar. You could use whatever build tool you want to compile your solution (i.e. msbuild, nant)and you could use the simple sonar java runner to trigger the analysis.
Check out the official wiki and feel free to ask questions to the user mailing list.
You can subscribe easily here : Support

Resources