Error building java desktop application from eclipse - java

I am trying to build a github project pdfSAM on eclipse. The dependencies are JAVA 8, getText and Maven. I installed all the plugins on eclipse but when I build the project using pom.xml I am getting an error for pdfsam-core project-
"Failed to execute goal on project pdfsam-core: Could not resolve dependencies for project org.pdfsam:pdfsam-core:jar:3.0.0.RELEASE-SNAPSHOT: The following artifacts could not be resolved: org.sejda:sejda-model:jar:2.0.0-alpha13, org.sejda:sejda-conversion:jar:2.0.0-alpha13: Failure to find org.sejda:sejda-model:jar:2.0.0-alpha13 in https://repository.jboss.org/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced -> [Help 1] "
Build error on eclipse
I also tried building the project from command line using commands
1.mvn clean install
2.mvn clean install -PfastTests
3.mvn clean install -Dmaven.test.skip=true
All the commands give me me same error and a Build failure occurs.
I am also inserting the pom.xml file of pdfsam-core-
<?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>
<description>Core pdfsam library</description>
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>3.0.0.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-i18n</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.jensd</groupId>
<artifactId>fontawesomefx</artifactId>
</dependency>
<dependency>
<groupId>org.sejda</groupId>
<artifactId>sejda-model</artifactId>
</dependency>
<dependency>
<groupId>org.sejda</groupId>
<artifactId>sejda-conversion</artifactId>
</dependency>
<dependency>
<groupId>org.sejda</groupId>
<artifactId>eventstudio</artifactId>
</dependency>
<dependency>
<groupId>jdepend</groupId>
<artifactId>jdepend</artifactId>
</dependency>
</dependencies>
</project>
Kindly give me a solution to this.

Two easy (possible) fixes:
Try to delete the artifact in your local repo and rebuild to trigger a download.
Use the -U maven goal to update the snapshot.
Top answer from experience, 2nd answer from:
When maven says "resolution will not be reattempted until the update interval of MyRepo has elapsed", where is that interval specified?

Related

Maven pom file, what is it doing?

I have just started using Maven, in a newbie capacity, just want to understand something around dependencies.
I am trying to build a micro web service using iText and the pdf output functionality.
So my very first steps is seeing if I can get a pdf output from a very simple Java program.
In my pom file i have the following dependencies:
<!-- iText Core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>${itext.version}</version>
<type>pom</type>
</dependency>
<!-- iText pdfHTML add-on -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>html2pdf</artifactId>
<version>2.1.6</version>
</dependency>
After reading the information on the Maven site, the pom file should do all of the heavy lifting in getting the dependencies, this is the bit i'm a little confused on.
Will the pom file physically download the files to the the app location on application start so that he app can utilize these files?
if that's the case it doesn't seem to be doing this and so am I missing something in the pom file to enable this?
The full pom file is:
<?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>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<itext.version>RELEASE</itext.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- iText Core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>${itext.version}</version>
<type>pom</type>
</dependency>
<!-- iText pdfHTML add-on -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>html2pdf</artifactId>
<version>2.1.6</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Any help appreciated.
Thanks
When maven build is executed, Maven automatically downloads all the dependency jars into the local repository.
the local repository of Maven is a folder location on the developer's machine, where all the project artifacts are stored locally.
Usually this folder is named .m2.
Here's where the default path to this folder is – based on OS:
Windows: C:\Users\User_Name\ .m2
Linux: /home/User_Name/.m2
Mac: /Users/user_name/.m2
https://www.baeldung.com/maven-local-repository
Maven does download the dependencies to the local m2 repository. But this is more meant for building the application, not for running.
What you want (copy the dependencies next to the output jar) can be achieved with the goal dependency:copy-dependencies
See this blog post:
https://technology.amis.nl/2017/02/09/download-all-directly-and-indirectly-required-jar-files-using-maven-install-dependencycopy-dependencies/
Managing dependencies is one of the key features of Maven.
Dependency management: It is possible to define dependencies to other
projects. During the build, the Maven build system resolves the
dependencies and it also builds the dependent projects if needed.
Resolving dependencies does mean it downloads all the specified jars in the local system.
The Maven tooling reads the pom file and resolves the dependencies of
the project. Maven validates if required components are available in a
local repository. The local repository is found in the .m2/repository
folder of the users home directory.
Note that .m2/ is a hidden folder. If you are using Linux, would be this path /home/someuser/.m2
Read this
If however its not downloading the jars or creating the .m2 directory at all, then either you are not building the project right or you are not connected to the internet.

How to build nifi processor nar file and dependencies from maven central

I am trying to build a nar file from maven repo central. I am not very used to maven, so I will explain the steps I followed until the blocking point where I am stuck now.
I want to generate the nar files for this artifact:
https://mvnrepository.com/artifact/org.apache.nifi/nifi-hwx-schema-registry-nar/1.10.0
So I created this pom.xml file:
<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>TestMaven</groupId>
<artifactId>TestMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hwx-schema-registry-nar</artifactId>
<version>1.10.0</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<artifactItems>
<artifactItem>
<!-- hardcode values, or use properties, depending on what you want
to do -->
<groupId>TestMaven</groupId>
<artifactId>TestMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>[ packaging ]</type>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And then I try to compile whit this commands (first commands are to include maven dependencies on the PATH):
export JAVA_HOME=/usr/jdk64/jdk1.8.0_112
export M2_HOME=/usr/local/apache-maven
export M2=$M2_HOME/bin export PATH=$M2:$PATH
mvn -U -X dependency:copy-dependencies -DskipTests
-Dclassifier=sources -DoutputDirectory=target -Dhttp.proxyHost=X.X.X.X -Dhttp.proxyPort=80 -Dhttps.proxyHost=X.X.X.X -Dhttps.proxyPort=80
And I am getting this error, which says that the maven dependency couldn't be found:
[ERROR] Failed to execute goal on project TestMaven: Could not resolve
dependencies for project TestMaven:TestMaven:jar:0.0.1-SNAPSHOT: Could
not find artifact
org.apache.nifi:nifi-hwx-schema-registry-nar:jar:1.10.0 in central
(https://repo.maven.apache.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal on project TestMaven: Could not resolve dependencies for
project TestMaven:TestMaven:jar:0.0.1-SNAPSHOT: Could not find
artifact org.apache.nifi:nifi-hwx-schema-registry-nar:jar:1.10.0 in
central (https://repo.maven.apache.org/maven2)
Thank you
You would need to get the source code for Apache NiFi version 1.10.0 and then build that module.
You could get the code by cloning the git repo and checking out the tag rel/1.10.0.
https://github.com/apache/nifi/tree/rel/nifi-1.10.0/nifi-nar-bundles/nifi-standard-services/nifi-hwx-schema-registry-bundle
Then run mvn clean package from the location above.

Cannot create custom BOM. Project build fails with Non-resolvable import POM: Could not find artifact

I am using eclipse mars with embedded maven (version 3.3.9) and i am facing a problem i cannot understand in order to resolve it. I have been trying to create a JMS related "library" that some other projects can use in their pom under their dependencyManagement section (in other words following the "BOM" pattern). However, when the created BOM is pulled in the dependencyManagement section of the corresponding project that is supposed to use it, the dependencies specified are pulled in, but the project build itself (mvn clean install) fails with an error shown further down.
The structure i used is the following:
A "jms-dependencies-BOM" project (packaged as pom), which includes as a submodule a "jms-dependencies-parent" project (again packaged as pom) which in turn inherits from the "jms-dependencies-BOM" project. Additionally, there is a "amqdeps" submodule of the aforementioned "jms-dependencies-parent" project (packaged as a jar). The "amqdeps" submodule also inherits from the "jms-dependencies-parent" project. The corresponding project that is supposed to import the "jms-dependencies-BOM" pom in its dependencyManagement section and use the "amqdeps" dependency in the dependencies section is "TestIntegrator".
Although it does sound like a duplicate i am not sure it is. My error message is a bit different (no mention of an incorrect relative path for example as in other questions).Now i have tried everything i could think of, purging the whole .m2/repository folder, tried to build the TestIntegrator project from the cli using even a slightly different maven version (3.2) than the embedded one in eclipse. Basically i have tried everything suggested by similar questions asked,all to the same result. I suppose it is something with the way i have structured the BOM hierarchy of the projects (the relative paths perhaps, although the compiler does not complain about it) but i do not understand it enough.
"jms-dependencies-BOM" 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>jms-dependencies-BOM</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<amqdeps.version>0.0.1-SNAPSHOT</amqdeps.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>amqdeps</artifactId>
<version>${amqdeps.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>jms-dependencies-parent</module>
</modules>
</project>
The "jms-dependencies-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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test</groupId>
<artifactId>jms-dependencies-BOM</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>com.test</groupId>
<artifactId>jms-dependencies-parent</artifactId>
<packaging>pom</packaging>
<properties>
<activemq.version>5.13.1</activemq.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-openwire-legacy</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-jaas</artifactId>
<version>${activemq.version}</version>
</dependency>
<--MORE DEPENDENCIES TRUNCATED FOR CLARITY-->
</dependencies>
</dependencyManagement>
<modules>
<module>amqdeps</module>
</modules>
</project>
The "amqdeps" 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test</groupId>
<artifactId>jms-dependencies-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>amqdeps</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-openwire-legacy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>
<--MORE DEPENDENCIES TRUNCATED FOR CLARITY-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
</plugins>
</build>
</project>
and finally the "TestIntegrator" 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>TestIntegrator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<spring.framework.version>5.1.4.RELEASE</spring.framework.version>
<jms-dependencies-BOM.version>0.0.1.SNAPSHOT</jms-dependencies-BOM.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.framework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.test</groupId>
<artifactId>jms-dependencies-BOM</artifactId>
<version>${jms-dependencies-BOM.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.test</groupId>
<artifactId>amqdeps</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
</plugins>
</build>
</project>
When i do a mvn clean install in the parent project (i.e. "jms-dependencies-BOM") everything is build and i can see the corresponding poms for the "jms-dependencies-BOM",
"jms-dependencies-parent" and "amqdeps" (and the jar for the amqdeps project as well) being installed in the corresponding .m2/repository folder under directories of com/test/... . In addition i can see the dependencies listed in the amqdeps project being pulled in the TestIntegrator project, with no errors showing anywhere. However, every time i try to perform a mvn clean install from the IDE in the TestIntegrator project it fails with the following error:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not find artifact com.test:jms-dependencies-BOM:pom:0.0.1.SNAPSHOT # line 43, column 16
[ERROR] 'dependencies.dependency.version' for com.test:amqdeps:jar is missing. # line 104, column 14
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.test:IgniteIntegrator:0.0.1-SNAPSHOT (C:\Users\matrix\eclipse-mars\workspace\TestIntegrator\pom.xml) has 2 errors
[ERROR] Non-resolvable import POM: Could not find artifact com.test:jms-dependencies-BOM:pom:0.0.1.SNAPSHOT # line 43, column 16 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for com.test:amqdeps:jar is missing. # line 104, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Can anyone help me out please?
The reason for this particular error seems to be a simple typo in the version string. Your are trying to import
<jms-dependencies-BOM.version>0.0.1.SNAPSHOT</jms-dependencies-BOM.version>
while the project version is actually
<version>0.0.1-SNAPSHOT</version>
Note the . vs - difference.
That said, I do believe you should read more about Project Inheritance vs Project Aggregation and make sure you understand the details of how reactor builds work. Then perhaps you may want to re-think how you structure your modules. I'm not judging you (may be you have your good reasons to do what you do), but at first look it seams your multi-module structure is somewhat messy and thus fragile.

Creating apklibs with maven and IntelliJ

I'm creating a apklib from sliding menu because I couldn't find any maven repository. The problem is that when I try from intellij, It imports the library but doesn't add the dependencies to sliding menu library and I have to add it manually.
<?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.slidingmenu</groupId>
<artifactId>library</artifactId>
<version>1.2</version>
<type>apklib</type>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v13</artifactId>
<version>r12</version>
</dependency>
<dependency>
<groupId>com.github.rtyley</groupId>
<artifactId>roboguice-sherlock</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.roboguice</groupId>
<artifactId>roboguice</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.2.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<nativeLibrariesDirectory>ignored</nativeLibrariesDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
I create the zip, according to the instructions on maven plugin and then I push it to ~/.m2 with this command:
mvn org.apache.maven.plugins:maven-install-plugin:2.4:install-file -DgroupId=com.slidingmenu -DartifactId=library -Dfile=sliding-menu.apklib -Dversion=1.2 -Dpackaging=apklib
You need to install com.slidingmenu in your local repository with mvn clean install instead of install:install-file
mvn clean install will put all the meta-data and the dependencies required by maven in your local repository (i.e. ~/.m2/repository).
In your apk, specify the artifact com.slidingmenu as a dependency of type apklib
I hope it will solve your problems.

Changes not effect in the latest jar using maven [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I need to do some enhanements in struts2-jquery grid plugin. I downloaded the source from https://struts2-jquery.googlecode.com/svn/trunk. I changed the logic in this source. When I execute my POM.xml file using mvn package. I received the exception
"The project com.jgeppert.struts2.jquery:struts2-jquery-grid-plugin:3.5.0-SNAPSHOT
have 1 error
Non-resolvable parent POM:could not find artifact com.jgeppert.struts2.jquery:struts2-
jquery:pom:3.5.0-snapshot and 'Parent.relativePath' points at wrong local POM #line 5,c
olumn 13 "
My pom.xml file is shown below.
<?xml version="1.0"?>
<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>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>
<artifactId>struts2-jaquery-grid-plugin</artifactId>
<name>Struts 2 jQuery Grid Plugin</name>
<packaging>jar</packaging>
<scm>
<connection>scm:svn:http://struts2-jquery.googlecode.com/svn/trunk/struts2-jquery-grid-plugin</connection>
<developerConnection>scm:svn:https://struts2-jquery.googlecode.com/svn/trunk/struts2-jquery-grid-plugin</developerConnection>
<url>http://code.google.com/p/struts2-jquery/source/browse/</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.39</version>
<configuration>
<A>
uri=/struts-jquery-grid-tags,
tlibVersion=${tlib.version},
jspVersion=2.0,
shortName=sjg,
displayName="Struts2 jQuery Grid Tags",
outFile=${basedir}/target/classes/META-INF/struts-jquery-grid-tags.tld,
description="Struts2 tags based on jQuery and jqGrid.",
outTemplatesDir=${basedir}/src/site/docs
</A>
<resourceTargetPath>target</resourceTargetPath>
<fork>false</fork>
<force>true</force>
<nocompile>true</nocompile>
<showWarnings>true</showWarnings>
<factory>
org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory
</factory>
<target>1.5</target>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Core -->
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0.4</version>
<optional>true</optional>
</dependency>
<!-- JSP API -->
<!-- struts-annotations must be in compile scope for maven-apt-plugin to
function correctly. Marking it optional to exclude it from transitive dependency resolution -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
As per my understanding, the parent tag looks at another pom.xml file. I tried to add a relative path in parent tag, but it's not working. I didn't see the parent pom.xml in https://struts2-jquery.googlecode.com/svn/trunk.
I removed the parent tag and added it into groupid , artifactId & version gave as 3.5.0-SNAPSHOT then its also failed. Again i changed 3.4.0 instead of 3.5.0-SNAPSHOT then its build .jar file. But its not effected my changes.
So how to run the pom file with latest changes of the code.Is there any alternative to create .jar file instead of run the pom.xml file.
The reason the build is failing is because there are dependencies (namely the parent pom and the struts2-jquery-plugin) that can't be found in the local repository, or in the current reactor build. The term reactor build refers to the project from which you run mvn and all child projects, referenced by <module> elements in the pom.
In your case, you either need to:
mvn install the parent pom and struts2-jquery-plugin into your local repository, and try what you're doing again;
change up a directory (i.e. to the trunk directory), and build the grid plugin as part of a reactor build that includes the parent pom and struts2-jquery-plugin.
First approach: If you go to the top-level of your checkout, i.e. trunk, and then run:
mvn -pl .,struts2-jquery-plugin install
It will install the snapshot versions of the parent pom and struts2-jquery-plugin into your local repository. You should then be able to run mvn package in the grid plugin directory.
Second approach: From trunk, you could run:
mvn -am -pl struts2-jquery-grid-plugin package
This will build the grid plugin together with any dependencies found in the reactor build, i.e. the parent pom, and the struts2-jquery-plugin itself.
As per error it trying download com.jgeppert.struts2.jquery:struts2-jquery-grid-plugin:3.5.0-SNAPSHOT since there is no version like this in maven repository.
replace your pom with below dependency, it will build fine.
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>3.4.0</version>
</dependency>

Categories

Resources