AEM 6.5 WKND repo build issues - maven

I created a maven project in batch mode by typing the following command:
mvn archetype:generate -B -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=22 -DgroupId=com.adobe.aem.guides -Dversion=0.0.1-SNAPSHOT -DappsFolderName=wknd -DartifactId=aem-guides-wknd -Dpackage=com.adobe.aem.guides.wknd -DartifactName="WKND Sites Project" -DcomponentGroupName=WKND -DconfFolderName=wknd -DcontentFolderName=wknd -DcssId=wknd -DisSingleCountryWebsite=n -Dlanguage_country=en_us -DoptionAemVersion=6.5.0 -DoptionDispatcherConfig=none -DoptionIncludeErrorHandler=n -DoptionIncludeExaples=y -DoptionIncludeFrontendModule=y -DpackageGroup=wknd -DsiteName="WKND Site"
when I type mvn -PautoInstallSinglePackage clean install
I get the following error:
[ERROR] Failed to execute goal on project aem-guides-wknd.ui.apps: Could not resolve dependencies for project com.adobe.aem.guides:aem-guides-wknd.ui.apps:content-package:0.0.1-SNAPSHOT: Could not find artifact com.adobe.aem.guides:aem-guides-wknd.ui.frontend:zip:0.0.1-SNAPSHOT
From the error I guess and when I searched that there is no such artifactid in maven repository. Can someone please help me out here?

If your sole requirement is to build the wknd project, then just download the maven project from git and import it as a maven project in eclipse. After that build it. That should hopefully resolve your issue.

You have below options :
1.You Can check your root pom.xml file. There you can comment out ui.frontend module i.e. <!--module> ui.frontend </module-->. After hat you can run your package build command.
2. you can got to each sub-module like core,ui.appss and run following command to build individually mvn clean install -PautoInstallBundle
Let me know if this helps or will look into some other solution.

Inside parent pom.xml comment dispatcher module
example :
<modules>
<module>all</module>
<module>core</module>
<module>ui.frontend</module>
<module>ui.apps</module>
<module>ui.apps.structure</module>
<module>ui.config</module>
<module>ui.content</module>
<module>ui.content.sample</module>
<module>it.tests</module>
**<!--<module>dispatcher</module>-->**
<module>ui.tests</module>
</modules>

Related

How to skip some java files from compilation in maven using command line?

I am using maven with jenkins. On eclipse the project build works fine. When I use jenkins I get the following error
[ERROR] /E:/jenkins/workspace/product/src/test/java/com/new/ftp/FTPTest.java:[102,55] package com.fasterxml.jackson.databind does not exist
The options for maven are as follows:
mvn clean install -X
I want to know if I can pass some arguements to maven to skip that package. I don't want to modify my pom.xml yet .
P.S - The project consists of a main pom.xml which calls other child modules.

Could not resolve dependencies for project, except when called with package

I have an EAR project, defined very similarly as the reference project of WildFly. In addition to that, I have another JAR project JarProject
which is included in:
parent's pom.xml (as a <module> and in its <dependencyManagement>)
the EjbProject's pom.xml (with the scope provided)
the EarProject's pom.xml (with the default scope, compile)
The problem is that when executing mvn eclipse:eclipse or mvn wildfly:deploy (from the parent project) it fails with the error
[ERROR] Failed to execute goal on project EjbProject: Could not resolve dependencies for project groupId:EjbProject:jar:0.0.4-SNAPSHOT: Could not find artifact groupId:JarProject:jar:0.0.4-SNAPSHOT -> [Help 1]
It somehow looks the JarProject in the local repository, and does not see it in the parent project.
Very important note: mvn package works without problems, as mvn package wildfly:deploy or mvn package eclipse:eclipse do, but without pacakgeing before eclipse:eclipse, it fails.
Maven version: 3.0.4 and 3.3.3
I'm not sure I got the question. Hope this will help...
Goals "eclipse:eclipse" and "wildfly:deploy" do not trigger building of your projects. To use a project as a dependency it needs to be built from the parent pom or installed in you repository.
When you do mvn package eclipse:eclipse the package triggers the build of the JarProject.
If you want do be able to do only mvn eclipse:eclipse then you need to perform a mvn install on your JarProject first.

Maven and Jsig CAS 4.0RC

I have downloaded the code from the repository but I have little experience to use maven (command line) to get the .war file to be included in my tomcat.
I do not have experience in this.
I have not changed the pom.xml file
I directly run the command mvn clean package but I have several errors.
Spete help me?
My goal is to generate the. War file CAS 4.0RC
I'm using the pom.xml file that I found on git (a very long file) can fit that?
If you've downloaded the source of CAS and its by itself should be a mavenized project then, pom.xml should be inside.
so you should just 'cd' to the root folder of your source and type
mvn install
or
mvn package
The first command will install your jar into local maven repository, the second one will only prepare the war in the target folder of the module with packaging war in the source.
If you encounter any errors, please post them here.
Hope this helps
It should build without any problem when executing mvn clean install in the CLI... What are your errors ?

Maven local repository

I want Maven to work offline. I downloaded all artifacts like spring and hibernate onto my computer. Then I tried to set up Maven to use local repository only. I followed instructions to point Maven to local repository. However every time I tried to load spring mvc project, I got the errors like this:
Offline / Missing artifact org.springframework:spring-context:jar:3.0.6.RELEASE:compile
Offline / Missing artifact org.springframework:spring-core:jar:3.0.6.RELEASE:compile
I checked the local repository. The jar and pom files are there. I can't figure out what is wrong with my configuration. Can someone help me out here?
Thanks.
Jerry
You probably messed up your settings.xml.
Correct way to prepare for offline is this:
mvn install dependency:go-offline
The answer bilash.saha gave will not work for multi module projects.
After first command finished, you may test that everything is ok by running
mvn -o package
To save you a from typing "-o" every time use this settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<offline>true</offline>
</settings>
Run
mvn dependency:go-offline
then build your project offline using the '-o' flag:
mvn install -o

maven-bundle-plugin: The defined artifact is not an archetype

I configured the "maven-bundle-plugin" from Apache Felix as a Maven Archetype in Eclipse (since it was missing), but when I try to create a new Maven project with it, I get as error:
Unable to create project from archetype [org.apache.felix:
maven-bundle-plugin:2.3.5 -> ]
The defined artifact is not an archetype
I then tried the same procedure with ops4j Pax (which is pre-configured in Eclipse), which seems to be something similar, and it worked, so I think I'm doing it right and the problem is with "maven-bundle-plugin".
What does the error message mean, and what can I do to fix it, or am I somehow getting this all wrong?
[EDIT] While I can create the project with ops4j Pax, I afterward get:
Project build error: Unknown packaging: bundle
which as apparently been fixed in 2009! So this obviously doesn't work either.
I finally had success with the following procedure:
cd workspace
mvn org.ops4j:maven-pax-plugin:create-bundle -Dpackage=demo.service
-DbundleGroupId=demo.service -DbundleName=demo.service-bundle
-Dversion=0.1
cd demo.service-bundle
mvn org.ops4j:maven-pax-plugin:eclipse
# Import project as Eclipse project
# (I haven't try to import it as maven project)
And btw, it took me about ages to work out why this doesn't work in a Windows batch file: that is because mvn is itself a batch file, and so you have to use "call".

Resources