I've imported magnolia-module-standard-templating-kit maven dependency in Pom file in webapp. It's version is 2.3.0 and Magnolia version is 5.3. After build & run Tomcat server and start install modules, I encountered a failure as below:
Magnolia Data Module (version 2.3.0)
Could not install or update data module. Task 'Data AppLauncher group ordering' failed. (PathNotFoundException: /modules/ui-admincentral/config/appLauncherLayout/groups/data)
pom.xml:
<!-- Overlay Magnolia Empty Webapp. Alternatively, use the bundled-webapp or the enterprise-webapp. Dependencies versions are already imported by parent, so no need to replicate here. -->
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-empty-webapp</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-empty-webapp</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>com.mycompany.projects</groupId>
<artifactId>myTemplateModule</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.magnolia.contacts</groupId>
<artifactId>magnolia-contacts</artifactId>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-standard-templating-kit</artifactId>
</dependency>
Anyone can help me resolve this problem?
I managed to replicate the exception you get and i think the problem is the order you add the dependencies and do the "Start install" process.
if i first do a "Start install" with only the magnolia-empty-webapp dependencies and then i stop the server, add the magnolia-module-standard-templating-kit to the pom.xml and do another "Start install" i got the exception:
But if instead i do a "Start install" specifying all the dependencies (stk and empty-webapp) from the beginning i don't get an exception at all
I recommend you to add these dependencies as well for demo project and the pop theme
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-theme-pop</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-demo-project</artifactId>
<version>${project.version}</version>
</dependency>
Related
Fair amount of experience with java but have only made console applications without using any dependencies. I am currently trying to make a rest api to handle request for my web application. I am using Apache Maven 3.6.3 and have the dependencies in my pom.xml file.
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies>
When I try to compile my project I get the same error for each of my dependencies (listing the error for the http client)
error: package org.apache.http.client.methods does not exist
I think the problem is connected with some dependencies which use an old version of this library. A possible solution is to add in the pom file the dependency in the dependencyManagement, this is a way to override all the possible imports of the library.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies>
</dependencyManagement>
In Eclipse, when I go to myProject -> right click -> Run As -> Maven build, I am getting multiple errors in the console outlining that certain packages does not exist, like:
javax.ws.rs does not exist
javax.ws.rs.core does not exist
javax.servlet does not exist
javax.servlet.http doest not exist
Although in my pom.xml, I have provided those dependencies:
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
<version>1.0</version>
</dependency>
etc
under
<dependencyManagement><dependecies>
tags (don't have any errors in pom.xml).
I do also have proxy settings configured in settings.xml file, and this file is properly linked.
I've also got these jars included locally to WebContent\WEB-INF\lib folder and added to the classpath (I can run my REST service on tomcat, the error "package does not exist" appears only when I am trying to use Maven build".
The reason I need that I want to generate and deploy a .war file.
How I can solve this? Is there a war to force Maven look in local libraries instead?
If you have:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
then you need to have a separate:
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</dependency>
</dependencies>
section.
Typically you would define dependencyManagement in a parent pom.xml file and then use the second dependencies fragment in child pom.xml files. This ensures that all your modules depend upon the same consistent artifacts.
My osgi bundle in servicemix need com.sun.javadoc for start.
I find dependency in maven repository but without success : the dependency in this link [here]
I try :
<dependency>
<groupId>javadoc</groupId>
<artifactId>javadoc</artifactId>
<version>1.3</version>
</dependency>
and
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
... without success.
So, I look for maven dependency for com.sun.javadoc with version : 1.7.0
thx
I resolved the problem :
In my pom.xml I make :
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>My_JAVA_HOME/lib/tools.jar</systemPath>
</dependency>
and in <Embed-Dependency> section I take the artifactId for this dependency, in my case it's "tools"
new mvn install and now in servicemix not stack for com.sun.javadoc
Just add tools.jar to your library folder.
example if you are using IntelliJ IDEA:
file->project structure->Libraries->(+) new project library->
Choose tools from your JDK path ->
your problem must be resolved
I have maven project. Maven build complete SUCCESS. But i can't make this project.
[INFO] BUILD SUCCESS
Project contains one module. Idea can't see dependencies.
Error:(3, 38) java: D:\Dropbox\Programming\java\spring\springBook\src\main\java\ch14\validator\ContactTestValidator.java:3:
package org.springframework.stereotype does not exist
POM:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>springBook</groupId>
<artifactId>springBook</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- Shared version number properties -->
<properties>
<org.springframework.version>3.2.3.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<!--для валидации бинов необходима-->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<!--Spring Data JPA использует его - добавим и пользуемся-->
<!--API для работы с датами-->
<!--ch14 validator-->
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<!--ch14 validator-->
<!--API интерфейса JSR-303-->
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<!--ch14 validator-->
<!--API, которая поддерживает интерфейс JSR-303 - BeanValidation-->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
</dependency>
<dependency>
<!--для валидации. (#Type...)-->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
</dependency>
<!--Spring framework-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
<build>
<finalName>springBook</finalName>
</build>
</project>
Could you help me? Unfortunately, I can't add screenshots..
There are screenshots:
http://screencast.com/t/iNaWO9gy
http://screencast.com/t/iBGTyMpgH
Project settings - Libraries - empty;
reimport didn't help;
Do the following steps:
Find your pom.xml in your files
Right click on it --> Maven --> Import
Wait for the project to load :D
Press ctrl+alt+shift+s (This opens the Projects window.)
Go to libraries and see if they are empty (they shouldnt)
If they are post your full pom.xml please so I can see the problem
If you still have a problem got to File --> Invalidate Caches
/Restart
Go to maven and Reimport All Maven Projects
Option Maven -> Reimport
should force Intellij to reload all dependencies. Alternatively, as mentioned in comments you can click the Reimport All Maven Projects button in Maven Projects view.
In my case, I had my own apache-maven-3.5.2 folder and a misconfiguration created my problem. Maybe it's your case too:
In rush, I set the local repository to C:/my/folder/apache-maven-3.5.2/settings.xml, but it must be a folder so Maven didn't allow me to download the dependencies. Then I changed the default (in the picture) and it worked.
Open the module dependencies (press F12 on the module), go to Modules -> Dependencies and make sure maven imports are part of the of this.
Try to import the project from sources, if this answer didn't help you.
The following worked for me.
Deleted the maven dependency from my local repository
mvn clean install downloaded the dependency again
File --> Invalidate Caches/Restart
I still saw the compilation error
on my mac, I hit option + enter, intellij asked me to add the jar to classpath
build -> make project
I had faced the same problem, and the issue was small. I had changed the location of settings.xml file of maven and Intellij was picking up the default from C:\users\.m2\settings.xml
So point your maven settings.xml to the correct file as below:
File--> Settings--> Build, Execution, Deployment--> Maven
then on the right window, override "User settings file" to the settings.xml where you have in your local disk.
If you have installed maven in a non-default location then this file you can find in:
\apache-maven-3.2.3\conf\settings.xml
Right click on pom.xml and click Add as Maven Project
I am having trouble building an EJB EAR with Maven in Eclipse 3.6 with the m2eclipse project builder. Curiously, a manual build (either on the command line or with "Run as -> Maven build") works fine. I have set up Eclipse to use an external Maven 2.2.1 installation.
The error message is as follows:
Build errors for my-app; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml) on project my-app: Failed to initialize ear modules
So apparently generation of the application.xml descriptor fails for some reason I could not yet determine.
In the error log view I have the following message:
Unknown artifact type[test-jar]
I have read in a forum that might be caused by a "test-jar" dependency that is missing "test" scope; however, I have double- and triple-checked for this and can't find any unscoped "test-jar" dependencies in my pom.xml files.
I've found the following entries with mvn help:effective-pom though:
<dependency>
<groupId>org.jboss.test</groupId>
<artifactId>jboss-test</artifactId>
<version>1.1.4.GA</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>apache-log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- ... --->
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>integration-mdb20</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>integration-mdb20-durable</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>integration-mdb20-selector</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>integration-mdb20-userTransaction</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>integration-mdb20-userTransactionDups</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>jboss.jms-integration-tests</groupId>
<artifactId>jms-integration-tests</artifactId>
<version>1.0.1.GA</version>
</dependency>
I have no idea where those dependencies come from or if they are relevant at all.
The most curious thing is that, like I said, building works fine when I do it manually.
However, this means that I can't use some m2eclipse features like WTP integration.
Any suggestions?
To find where dependencies come from, open your pom in m2eclipse's Maven POM editor. On the right hand side of the 'Dependency Hierarchy' tab, is the resolved dependency list. This is synonymous with the effective-pom dependency listing. Select any dependency on the right and where that dependencies comes from will be revealed on the left.