Kaa - Maven repository for building Custom log appender - kaa

https://kaaproject.github.io/kaa/docs/v0.10.0/Customization-guide/Customizable-system-components/Log-appenders/
The above link gives an example of the Maven POM required to build the log appender. Are the dependencies available in the central maven repository ? (I dont think so)
So is the below repository configuration required in the POM ?
<repository>
<id>repository.kaaproject</id>
<url>http://repository.kaaproject.org/repository/internal/</url>
</repository>
<repository>
<id>repository.kaaproject.snapshots</id>
<url>http://repository.kaaproject.org/repository/snapshots/</url>
</repository>

You can add required repository as described here.

Related

Alfresco Configuration to Eclipse or by Maven

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

Maven: how to setup my pom.xml so that it can fetch dependencies via HTTP and deploy module via FTP

I'm trying to setup the pom.xml for one of my projects. And I can't figure out how to make it fetch dependencies via HTTP, but deploy new artifacts via FTP.
Here's the situation. I have a multi-module project on which I am working collaboratively with some other people. I also happen to rent a cheap web server that could allow me to share release and snapshot versions of some of my modules via a maven repository.
I want deployment to the repository to be authenticated (so that only authorized people can write to it) and to be done via FTP.
On the other hand, I want everyone to be able to download the published version of the artifacts anonymously via HTTP.
So far, the only thing I found was to add the following section to my pom.xml
<distributionManagement>
<snapshotRepository>
<id>my.repo.snapshots</id>
<name>My Repository - Snapshots</name>
<url>${url}/snapshots</url>
</snapshotRepository>
<repository>
<id>my.repo.releases</id>
<name>My Repository - Releases</name>
<url>${url}/releases</url>
</repository>
</distributionManagement>
The problem with this setup is that it doesn't let me pick FTP for upload and HTTP for download.
Is there any way to configure my pom.xml to do that?
Turns out the solution was right under my nose. The repositories for deploying artifacts are indeed configured through <distributionManagement/>, but repositories for fetching artifacts are configured through the <repositories> element in the <profiles> section.
My working pom.xml configuration now includes:
<distributionManagement>
<repository>
<id>deploy.releases</id>
<name>Repository - Releases</name>
<url>ftp://ftp.domain.com/releases/</url>
</repository>
<snapshotRepository>
<id>deploy.snapshots</id>
<name>Repository - Snapshots</name>
<url>ftp://ftp.domain.com/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>project.default</id>
<activation>
<property>
<name>!skipProjectDefaultProfile</name>
</property>
</activation>
<repositories>
<repository>
<id>repo.releases</id>
<url>http://maven.domain.com/releases/</url>
</repository>
<repository>
<id>repo.snapshots</id>
<url>http://maven.domain.com/snapshots/</url>
</repository>
</repositories>
</profile>
</profiles>
on top of that, my settings.xml contains the authentication information for FTP
<servers>
<server>
<id>deploy.releases</id>
<username>user</username>
<password>pass</password>
</server>
<server>
<id>deploy.snapshots</id>
<username>user</username>
<password>pass</password>
</server>
</servers>

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

Problems with servlets and maven

i am trying to build my first servlet using maven but don't know what i should add to the POM so the servlet
I have tried to add the below dependencies to the POM file (I found in one of the posts). The addition enables me to compile my servlet but when i try to run mvn package or to test my JUnits i am getting a ClassFormatError:
Initial SessionFactory creation failed.java.lang.ClassFormatError:
Absent Code attribute in method that is not native or abstract
in class file javax/validation/Validation
The pom.xml is:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<repository>
<id>java.net2</id>
<name>Repository hosting the Java EE 6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
can someone explain and guide?
Thanks
:-)
At the outset, you may want to follow Senthil's comment above.
As for the error, it is because the specified dependency only has the APIs (method definitions) and not the implementation.
Typically, the implementation is provided by the app server. Hence the application should work in an app server which implements Java EE 6 (like Glassfish).
mvn package should not give any error - it is the test phase before packaging which fails, which you can circumvent, if interested using mvn package -DskipTests.

Resources