I have dial with AIR mobile application based on 's:ViewNavigatorApplication'.
I use Apache Flex SDK 4.10 and Flexmojos plugin 6.0.1 and JetBrains IDEA 12.1.4
I made 'pom.xml', added 'air-framework' dependencies. The IDE imported it successfully and made the project configuration. The dependencies are shown under the 'Extranl Libraries' node, I can see it. But I don't see ViewNavigatorApplication class, I only see WindowedApplication. The 'pom.xml' loads 'airmobile-config.xml'. When I try to compile it, I get the error 'Error: Could not resolve 's:ViewNavigatorApplication' to a component implementation'. I will soon tear my hair out from my head.
Here is the pom.xml I use.
<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>
<name>Mobile Catalog</name>
<parent>
<groupId>com.uni.versal</groupId>
<artifactId>versal</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<artifactId>mobile-catalog</artifactId>
<packaging>air</packaging>
<properties>
<!--the application name which must match the main mxml file-->
<!--and application descriptor file names -->
<application.name>MobileCatalog</application.name>
</properties>
<build>
<directory>${project.basedir}/target</directory>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src/main/flex</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.air</groupId>
<artifactId>compiler</artifactId>
<version>${air.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<!--<targetPlayer>11</targetPlayer>-->
<swfVersion>13</swfVersion>
<flexBuilderCompatibility>true</flexBuilderCompatibility>
<loadConfig>${settings.localRepository}/com/adobe/flex/framework/framework/${flex.version}/configs_zip/airmobile-config.xml</loadConfig>
<sourceFile>${application.name}.mxml</sourceFile>
<descriptorTemplate>${basedir}/src/main/flex/${application.name}-app.xml</descriptorTemplate>
<!--<configurationReport>true</configurationReport>-->
<keystore>${project.basedir}/mobile_catalog.p12</keystore>
<storepass>asdf</storepass>
<!--optionally include files in the AIR package -->
<includeFileSets>
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>*.*</include>
</includes>
</fileSet>
</includeFileSets>
<storepass></storepass>
<contextRoot>versal</contextRoot>
<!--<localesCompiled>-->
<!--<locale>en_US</locale>-->
<!--<locale>ru_RU</locale>-->
<!--</localesCompiled>-->
<localesSourcePath>src/main/locales/{locale}</localesSourcePath>
<defines>
<property>
<name>CONFIG::debug</name>
<value>true</value>
</property>
<property>
<name>CONFIG::release</name>
<value>false</value>
</property>
</defines>
<debug>true</debug>
<optimize>false</optimize>
</configuration>
<executions>
<execution>
<goals>
<goal>sign-air</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework.air</groupId>
<artifactId>air-framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
Thanx in advance.
RESOLVED: Officially Flexmojos doesn't support AIR mobile applications. That's all.
Related
Current working code:
I am able to build a flex project using flexmojos-maven-plugin successfully. However, I can only provide one 'sourceFile' under my plugin configuration. Refer below my working pom.xml, which builds Main.mxml file correctly from 'src' directory. It generates the 'swf' file for Main.mxml successfully:
<?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.test</groupId>
<artifactId>TA_UI_Test2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>TA_UI_Test2 Flex</name>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>10-3.3.0.4852</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>rpc</artifactId>
<version>4.5.1.21328</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>framework</artifactId>
<version>3.2.0.3958</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>mx</artifactId>
<version>4.5.0.19786</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.8</version>
<extensions>true</extensions>
<configuration>
<sourceFile>Main.mxml</sourceFile>
<debug>true</debug>
<storepass/>
</configuration>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.2.0.3958</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Problem description:
Now I have got multiple other mxml files under my 'src' directory, i.e. all mxml files under one single 'src' directory. How do I add them in above plugin, which only expects one single name in sourceFile configuration?
Things I have tried:
I tried copy-pasting multiple blocks of flexmojos-maven-plugin, and each of them having different sourceFile specified. However, that does not help, because maven just generates the final 'swf' file from the last block of flexmojos-maven-plugin. For eg. if first plugin block has sourceFile Main.mxml, and second plugin block has sourceFile Secondary.mxml, then the 'swf' will be generated for Secondary.mxml only, not for Main.mxml.
Could you provide any other suggestions to generate individual swf files for respective mxml files using single pom/maven build?
After quite a lot of R&D, trying a few hacks, and based on valuable suggestion of Christofer Dutz on this forum, finally a clean solution is available for above problem. Here is the updated pom.xml, which will generate the individual swf files for provided source files:
<?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.test</groupId>
<artifactId>TA_UI_Test2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>swf</packaging>
<name>TA_UI_Test2 Flex</name>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>10-3.3.0.4852</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>rpc</artifactId>
<version>4.5.1.21328</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>framework</artifactId>
<version>3.2.0.3958</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>mx</artifactId>
<version>4.5.0.19786</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.8</version>
<extensions>true</extensions>
<configuration>
<storepass></storepass>
</configuration>
<executions>
<execution>
<id>default-compile-swf</id> <!--DO NOT change this ID, else the plugin execution will fail.-->
<configuration>
<sourceFile>File1.mxml</sourceFile>
<debug>true</debug>
<output>${basedir}/target/File1.swf</output>
</configuration>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
<execution>
<id>default-compile-swf-2</id>
<configuration>
<sourceFile>File2.mxml</sourceFile>
<debug>true</debug>
<output>${basedir}/target/File2.swf</output>
</configuration>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
<execution>
<id>default-compile-swf-3</id>
<configuration>
<sourceFile>File3.mxml</sourceFile>
<debug>true</debug>
<output>${basedir}/target/File3.swf</output>
</configuration>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.2.0.3958</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Important note: You have to provide the ID of any one of the executions as 'default-compile-swf', without which it would fail to identify the source file. For more information on the error which it will throw, refer to the link of the forum given above where I was discussing the same.
Hope this helps someone someday :)
I am trying to create my custom class for Sesame. I have my Eclipse (Mars) project with all Sesame librarys and a new project where I created my custom class as described in this tutorial and I folloved the instructions to install it in the other project as a local maven dependency install:install-file -Dfile=C:\Users\muletto.4\workspace\eternal_jars\CustomClassTest.jar -DgroupId=com.example -DartifactId=customclasstest -Dversion=0.1 -Dpackaging=jar -DgeneratePom=true but when I add the dependency to my pom.xml Eclipse id telling me that the artifact for my customclasstest is missing... and when I try to attache the source to if it is telling me that my jar is not correct. So my question is: How do I create a correct jar and what should be the content of it. Or maybe I am installing it in a wrong way? I tried searching but didn't found anything diffrent than the official instructions and I run out off ideas... Any help will be appreciated.
my pom.xml of the project in whih I try to install the jar:
<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>ECJCSesame</groupId>
<artifactId>ECJCSesame</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Execute Custom Java Classes</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-runtime</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>customclasstest</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
</project>
tess4j is an OCR packed with native library, I made a maven project to test it,
I did add the installation path of maven to eclipse.
I added M2_HOME, MAVEN_HOME and JAVA_HOME env variable,
here is my parent pom
<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>fr.mssb.ongoing</groupId>
<artifactId>ongoing-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>ongoing</name>
<modules>
<module>capcha-solver</module>
</modules>
<build>
<pluginManagement>
<plugins>
<!-- All project will be interpreted (source) and compiled (target) in java 7 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- this will make eclipse:eclipse goal work and make the project Eclipse compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</classpathContainer>
</classpathContainers>
<additionalBuildcommands>
<buildcommand>net.sf.eclipsecs.core.CheckstyleBuilder</buildcommand>
</additionalBuildcommands>
<additionalProjectnatures>
<projectnature>net.sf.eclipsecs.core.CheckstyleNature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- All child pom will inherit those dependancies -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
and here is my child pom
<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>
<parent>
<groupId>fr.mssb.ongoing</groupId>
<artifactId>ongoing-parent</artifactId>
<version>1.0</version>
</parent>
<groupId>fr.mssb.ongoing</groupId>
<artifactId>capcha-solver</artifactId>
<version>1.0</version>
<packaging>jar</packaging> <!-- I think this is useless -->
<name>A capcha solver based on terassec ocr</name>
<build>
<plugins>
<!-- autorun unit tests during maven compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx1024m -XX:MaxPermSize=256m -XX:-UseSplitVerifier</argLine>
<skipTests>-DskipTests</skipTests>
</configuration>
</plugin>
<!-- this should make the tesseract ocr native dll work without doing anything -->
<plugin>
<groupId>com.googlecode.mavennatives</groupId>
<artifactId>maven-nativedependencies-plugin</artifactId>
<version>0.0.7</version>
<executions>
<execution>
<id>unpacknatives</id>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!--
Log4j 2 is broken up in an API and an implementation (core), where the API
provides the interface that applications should code to. Strictly speaking
Log4j core is only needed at runtime and not at compile time.
However, below we list Log4j core as a compile time dependency to improve
the startup time for custom plugins.
-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.1</version>
</dependency>
<!--
Integration of tesseract OCR
-->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>
and of course, the code (taken from tess4j example)
package test;
import java.io.File;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
/**
* Classe d'exemple.
*/
public class TesseractExample {
public static void main(String[] args) {
File imageFile = new File("C:\\DEV\\repo\\ongoing\\capcha-solver\\src\\test\\resources\\random.jpg");
Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping
// Tesseract1 instance = new Tesseract1(); // JNA Direct Mapping
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
}
}
When I lauch it I'm getting this exception
Exception in thread "main" java.lang.NoSuchFieldError: RESOURCE_PREFIX
at net.sourceforge.tess4j.util.LoadLibs.<clinit>(LoadLibs.java:60)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:40)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:303)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:239)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:188)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:172)
at test.TesseractExample.main(TesseractExample.java:19)
I don't know if this is tess4j related or a JNA/JNI problem, as you can see I have a plugin that "should" (never worked with DLLs before) make them work.
Also in the parent pom my plugin are betwen plugin managment tags, I think I should have put them betwen build tags, no?
Any idea?
Thanks.
There was 2 problems
1/ some dlls and files from tess4j had to be copied to the project root directory
2/ tess4j had a transitive dependancy toward com.sun.jna:jna:jar:3.0.9 conflicting with net.java.dev.jna:jna:jar:4.1.0 (also from tess4j) ecluding the 3.0.9 version makes everything work, the RESSOURCE_PREFIX error was coming from that
pom.xml for 32 bit version (you need a 32 bit JVM installed) which takes care of those 2 things, change win32-x86 to win32-x86-64 if you want to use this in 64 bits
<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>fr.mssb.ocr</groupId>
<artifactId>tesseractOcr</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>tesseract ocr project</name>
<build>
<plugins>
<!--
this extract the 32 bits dll and the tesseractdata folder to
the project root from tess4j.jar
-->
<plugin>
<groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed-unpack-maven-plugin</artifactId>
<version>2.2.2</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>unpack-step</id>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<unpack>
<artifact>net.sourceforge.tess4j:tess4j:jar</artifact>
<overwrite>true</overwrite>
<resources combine.children="append">
<resource>
<path>win32-x86</path>
<destination>../</destination>
<overwrite>true</overwrite>
<flat>true</flat>
<include>*</include>
</resource>
<resource>
<path>tessdata</path>
<destination>../tessdata</destination>
<overwrite>true</overwrite>
<flat>true</flat>
<include>*</include>
</resource>
<resource>
<path>tessdata/configs</path>
<destination>../tessdata/configs</destination>
<overwrite>true</overwrite>
<flat>true</flat>
<include>*</include>
</resource>
</resources>
</unpack>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
<exclusions>
<exclusion>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
The child pom could be easily built without any problems and manually copying libs, this is not TESS4J related.
Anyway the jna 3.0.9 could be removed if not needed anymore: https://github.com/nguyenq/tess4j/issues/8
Still, all you have to do to run tess4j is the maven dependency:
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
</dependency>
and the correct use of the TESS4J-API, for example:
File imageFile = new File("C:\\random.png");
Tesseract instance = Tesseract.getInstance();
//In case you don't have your own tessdata, let it also be extracted for you
File tessDataFolder = LoadLibs.extractTessResources("tessdata");
//Set the tessdata path
instance.setDatapath(tessDataFolder.getAbsolutePath());
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
That's it!
The problem is caused by the conflict between net.java.dev.jna:jna and com.sun.jna:jna. Both jars contain a class com.sun.jna.Platform. Both jars are declared as tess4j dependencies. To solve this you can omit the second dependency in your pom:
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
<exclusions>
<exclusion>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
</exclusion>
</exclusions>
</dependency>
because the JNA version mismatch. you are using more than one version in class path library. just use one version of JNA.
I have a Maven project which is a part of a large scale enterprise system. I have not developed this project, but I have developed a small framework, which I am supposed to test, integrated with it. Upon copying, building and installing the project, it compiled, and I was able to launch it. However, after trying to add my framework (parent pom + 3 modules), I may have changed some settings, and now I am having trouble building the project. I have spent a lot of time trying to break down the problem, but all I have been able to do, is produce different errors, that I understand even less of.
I can't seem to find out where I can tell maven where to look for the parent POM. I have tried both the pom.xml, and settings.xml, but I haven't found any good options. I have also tried to change less obvious parameters, like changing localRepository, or adding repositories, but they proved ineffective
Here is my error message, interlaced with my attempts to fix it:
C:\development\my-main\customer-webpart>mvn install -Dmaven.test.skip=true
This is my domain. this includes the master pom of this project, although it is still part of a bigger system, and not the root. I would like to build, install and run this project, to test my framework. My framework is added as a dependency in the pom.xml.
[INFO] Scanning for projects...
Downloading: http://my-server:8080/archiva/repository/my-repository//
org/myportal/client-product/0.0/client-product-0.0.pom
I do not know where this archiva repository is defined. It is not in the pom.xml, or settings.xml. It seems to have an error with the double /, but the client-product-0.0.pom should not be retrieved from here anyway. It is located at C:/mavenLocalRepository/my-main/client-product/0.0/client-product-0.0.pom
Downloading: http://repo1.maven.org/maven2/org/myportal/
client-product/0.0/client-product-0.0.pom
This was also the wrong location to look for the .pom-file... so then the rest of the error is produced:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:customer-webpart:zip:${org.myportal.version}
Reason: Cannot find parent: org.myportal:client-product for project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.myportal:client-product for project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.myportal:client-product for
project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.ja
va:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.myportal:client-product' not found in repository: Unable to download the artifact from any repository
org.myportal:client-product:pom:0.0
from the specified remote repositories:
my-repository (http://my-server:8080/archiva/repository/my-repository/),
localRepository2 (C:/mavenLocalRepository/logging-framework/),
localRepository (C:/mavenLocalRepository/my-main/),
central (http://repo1.maven.org/maven2)
for project org.myportal:client-product
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:6
03)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
org.myportal:client-product:pom:0.0
from the specified remote repositories:
my-repository (http://my-server:8080/archiva/repository/my-repository/),
localRepository2 (C:/mavenLocalRepository/logging-framework/),
localRepository (C:/mavenLocalRepository/my-main/),
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:5
56)
... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Oct 28 11:15:40 CET 2014
[INFO] Final Memory: 4M/61M
[INFO] ------------------------------------------------------------------------
C:\development\my-main\customer-webpart>
Also, this Eclipse-warning is given on my parent-tag of pom.xml for the project:
Project build error: Non-resolvable parent POM: Failure to transfer org.myportal:client-product:pom:0.0 from http://my-server:8080/archiva/repository/my-repository/ was cached in the local repository, resolution will not be reattempted until the update
interval of my-repository has elapsed or updates are forced. Original error: Could not transfer artifact org.myportal:client-product:pom:0.0 from/to my-repository (http://my-server:8080/archiva/repository/my-repository/): Failed to transfer http://my-server:8080/archiva/repository/my-repository/org/myportal/client-product/0.0/client-product-0.0.pom. Error code 307, Temporarily Moved for Domain Name Expansion and 'parent.relativePath' points at wrong local POM
...and I have tried three different approaches to the parent.relativePath. 1. None at all (no tag present), 2. Empty tag (suggested at another post here) 3. tag with full path of the .pom file.
POM.XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>
<parent>
<groupId>org.myportal</groupId>
<artifactId>client-product</artifactId>
<version>0.0</version>
<relativePath>C:\mavenLocalRepository\my-main\org\myportal\client-product\0.0\client-product-0.0.pom</relativePath>
</parent>
<artifactId>my-webpart</artifactId>
<version>${org.myportal.version}</version>
<name>my-webpart</name>
<packaging>zip</packaging>
<description>
customer webpart
</description>
<properties>
<maven.test.skip>true</maven.test.skip>
<org.logging.framework.version>0.0.1-SNAPSHOT</org.logging.framework.version>
</properties>
<build>
<sourceDirectory>src/java</sourceDirectory>
<resources>
<resource>
<directory>src/java</directory>
</resource>
</resources>
<testSourceDirectory>src/test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>unzip-plugin</artifactId>
<version>${org.unzip.plugin.version}</version>
<executions>
<execution>
<id>unpack</id>
<goals>
<goal>unzip</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<resources>
<resource>
<groupId>org.workflow</groupId>
<artifactId>workflow-framework</artifactId>
<version>${org.myportal.version}</version>
<type>jar</type>
<includes>
<include>*.pdpart</include>
</includes>
<target>src/java/generated/common-pdparts</target>
</resource>
<resource>
<groupId>org.myportal</groupId>
<artifactId>myportal-portletframework</artifactId>
<version>${org.myportal.version}</version>
<type>jar</type>
<includes>
<include>*.pdpart</include>
</includes>
<target>src/java/generated/common-pdparts</target>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>descriptorloader-plugin</artifactId>
<version>${org.descriptorloader.plugin.version2}</version>
<executions>
<execution>
<id>vdoclet-java-clean</id>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/java</target>
</configuration>
</execution>
<execution>
<id>vdoclet-java</id>
<goals>
<goal>vdoclet</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/java</target>
<template>portletdescriptor/Control.vm</template>
<report>target/java-conversion.txt</report>
</configuration>
</execution>
<execution>
<id>vdoclet-jsp-clean</id>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/webapp</target>
</configuration>
</execution>
<execution>
<id>vdoclet-jsp</id>
<goals>
<goal>vdoclet</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/webapp</target>
<template>portletdescriptor/JspControl.vm</template>
<report>target/jsp-conversion.txt</report>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.main</groupId>
<artifactId>main-build-dependencies</artifactId>
<version>${org.main.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>zip-plugin</artifactId>
<version>${org.zip.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<fileSets>
<fileSet>
<directory>src/webapp</directory>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>WEB-INF/classes/</outputDirectory>
</fileSet>
</fileSets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<!-- Clean generated diretory -->
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src/java</directory>
<includes>
<include>**/generated/**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-portletdomain</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>effect-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mycase-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mycase-portletdomain</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<!-- myportal -->
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mysecondportal-common</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mysecondportal-webpartcommon</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>host-types</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.workflow</groupId>
<artifactId>workflow-framework</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${library.commons.fileupload.version}</version>
</dependency>
<!-- external -->
<dependency>
<groupId>faceless</groupId>
<artifactId>bfopdf</artifactId>
<version>0.0</version>
</dependency>
<!-- main -->
<dependency>
<groupId>org.main</groupId>
<artifactId>main-assemble-ear</artifactId>
<type>pom</type>
<version>${org.main.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-webdelegate</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>myportal-portletframework</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myshare</groupId>
<artifactId>myshare-common</artifactId>
<version>${org.myshare.version}</version>
</dependency>
<dependency>
<groupId>org.myshare</groupId>
<artifactId>myshare-webpartcommon</artifactId>
<version>${org.myshare.version}</version>
</dependency>
<dependency>
<groupId>org.docflow</groupId>
<artifactId>docflow-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.docflow</groupId>
<artifactId>docflow-webdao</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.esb.logging</groupId>
<artifactId>logging-framework</artifactId>
<version>${org.logging.framework.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>localRepository</id>
<url>C:/mavenLocalRepository/my-main/</url>
</repository>
<repository>
<id>localRepository2</id>
<url>C:/mavenLocalRepository/logging-framework/</url>
</repository>
</repositories>
</project>
parent (client-product-0.0.pom):
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>
<parent>
<groupId>org.product</groupId>
<artifactId>my-version-pom</artifactId>
<version>0.0</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.product</groupId>
<artifactId>my-product</artifactId>
<packaging>pom</packaging>
<version>0.0</version>
<name>my-product ${project.version} (old root-pom, now child of ${parent.artifactId})</name>
<modules>
<module>my-foundation-pom</module>
<module>pb-product-pom</module>
</modules>
<properties>
<!-- NISX: These properties should never be changed. Only change the value of org.component.version. -->
<org.assemble.my.version>${org.component.version.with.build.number}</org.assemble.my.version>
<org.myportal.version>${org.component.version}</org.myportal.version>
<org.myshare.version>${org.component.version}</org.myshare.version>
... + several others. shortened for stackoverflow
</properties>
<build>
<plugins>
<plugin>
<!-- NISX: This is a trick to avoid the ghost pom to be ever deployed to a repository. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<inherited>false</inherited>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>qdev-maven-plugin</artifactId>
<version>${org.qdev.plugin.version}</version>
<inherited>true</inherited>
<configuration>
<beaDeployDirectory>${qdev.deploy.dir}</beaDeployDirectory>
<earName>${qdev.ear.name}</earName>
<warName>${qdev.war.name}</warName>
<isSingleWar>true</isSingleWar>
</configuration>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>maven-udv-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<settingsApplicationName>my</settingsApplicationName>
<settingsApplicationVersion>${my.branch.name}</settingsApplicationVersion>
<settingsApplicationState>${profile.state}</settingsApplicationState>
</configuration>
</plugin>
</plugins>
</build>
</project>
I want to install oracle plugin--ojdbc6.jar.
when i run these command:
cd D:\sakai3\nakamura\contrib\oracle-jdbc-6
mvn install:install-file -DgroupId=com.oracle-jdbc-6 -DartifactId=ojdbc6 -Dversion=10.2.0.1.0 -Dpackaging=jar -Dfile=org.sakaiproject.nakamura.ojdbc.jar
mvn -P 10.2.0.1.0 clean install
cd D:\sakai3\nakamura
mvn clean install
cd D:\sakai3\nakamura\contrib\csu
mvn clean package
when i run the last one command i got this error:
[ERROR] Failed to execute goal on project edu.nyu.launchpad: Could not resolve d
ependencies for project edu.nyu:edu.nyu.launchpad:jar:1.4.2: The following artif
acts could not be resolved: org.apache.sling:maven-launchpad-plugin:jar:app:2.1.
0, org.sakaiproject.nakamura:org.sakaiproject.nakamura.ojdbc:jar:app:1.4.0, edu.
nyu:edu.nyu.launchpad:jar:app:1.4.2: Could not find artifact org.apache.sling:ma
ven-launchpad-plugin:jar:app:2.1.0 in maven repo (http://repo1.maven.org/maven2/
) -> [Help 1]
this is my pom:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>base</artifactId>
<version>1.4.2</version>
</parent>
<groupId>edu.nyu</groupId>
<artifactId>edu.nyu.launchpad</artifactId>
<name>NYU Launchpad</name>
<properties>
<nakamura.version>1.4.0</nakamura.version>
<ux.version>1.4.0</ux.version>
</properties>
<packaging>jar</packaging>
<build>
<resources>
<resource>
<directory>../../app/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-launchpad-plugin</artifactId>
<executions>
<execution>
<id>prepare-package</id>
<goals>
<goal>prepare-package</goal>
</goals>
<configuration>
<defaultBundleList>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>org.sakaiproject.nakamura.app</artifactId>
<version>${nakamura.version}</version>
</defaultBundleList>
<jarWebSupport>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>org.sakaiproject.nakamura.jetty-config</artifactId>
<version>${nakamura.version}</version>
<startLevel>5</startLevel>
</jarWebSupport>
<additionalBundles>
<bundle>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>org.sakaiproject.nakamura.ojdbc6</artifactId>
<version>${nakamura.version}</version>
<startLevel>1</startLevel>
</bundle>
<bundle>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>org.sakaiproject.nakamura.uxloader</artifactId>
<version>${ux.version}</version>
<startLevel>30</startLevel> </bundle>
</additionalBundles>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.launchpad.base</artifactId>
<version>2.3.0</version>
<classifier>webapp</classifier>
<type>war</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>maven-launchpad-plugin</artifactId>
<version>2.1.0</version>
<classifier>app</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
i am very sorry about my English. I am a Chinese.Please forgive my broken English and my unclear Expression.Sorry!And Thank you!
First of all you can remove the dependency on the maven-launchpad-plugin. I cannot see any rational reason for it to be bundled at all. Or am I missing something? The error you get is quite clear about this:
Could not find artifact org.apache.sling:maven-launchpad-plugin:jar:app:2.1.0
The plugin is used during your build and not needed as a dependency. Remove the following:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>maven-launchpad-plugin</artifactId>
<version>2.1.0</version>
<classifier>app</classifier>
<scope>provided</scope>
</dependency>
As a side-mark you should not pick up resources outside of the project like you do with this:
<resources>
<resource>
<directory>../../app/src/main/resources</directory>
</resource>
</resources>
The resources should be contained withing the project.