Maven: No plugin found for prefix 'install' - java

Last week my hard drive broke. Therfore I had to setup my system from scratch.
After donwloading some git projects and installing Java and Maven manually I tried to build my project again. But Maven says "no".
In my project I have some third party dependencies (2 JARs in the same project folder). My first step is to "install" those manually to the local maven repo.
mvn install:install-file -Dfile=lib/myjar.jar -DgroupId=com.my.group.id -DartifactId=MyArtifactId -Dversion=1.1 -Dpackaging=jar
But Maven says "no".
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:3.0.0:
...
[ERROR] No plugin found for prefix 'install' in the current project and in the plugin groups
I searched for a couple of days but I found no solution. In my POV it can not be ralated to network issues like proxy settings. I have full internet access and I checkt with serveral connections. My collegue in the same network has no problems.
mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: C:\Tools\apache-maven-3.5.3\bin\..
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.7.0_80\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
Thank you for your help :-)

You are using Java 7, which deserves extra attention when connection to Maven Central. About a month ago it can only be accessed via TLSv1.2. See Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central? for all the details.

Related

How to know which java version the Maven is using when build the project

I would like to know if it's possible check which Java version my Maven is using to build the project.
The JAVA_HOME was set to JDK 1.8.
In pom.xml I have this properties configured:
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
I try figured out a way to check it in mvn logs, but I can't find whitch version was used.
How to know the Java version throught some kind of mvn logs.
I appretiate any support.
In your command line if you run mvn -v it shows something like
Maven home: C:\maven\apache-maven-3.6.3\bin\..
Java version: 15.0.1, vendor: Oracle Corporation, runtime: C:\java\jdk-15.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Depending on where you build the project, in command line it would use the JAVA_HOME setting, in IDE it would use IDE settings for the project, e.g. in IDEA, go to Project Settings page (File -> Project Structure), you can check the Project SDK & Project language level settings on "Project" & "Modules" page, that shows which SDK & language level the current project used.

Which version of confluence do which versions of Atlassian plugin SDK support?

I've been trying to find out which versions of Confluence will my plugin support.
Here's the output of my atlas-version command:
ATLAS Version: 8.0.16
ATLAS Home: /usr/share/atlassian-plugin-sdk-8.0.16
ATLAS Scripts: /usr/share/atlassian-plugin-sdk-8.0.16/bin
ATLAS Maven Home: /usr/share/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4
AMPS Version: 8.0.2
--------
[INFO] Project POM found
Executing: /usr/share/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/bin/mvn --version -gs /usr/share/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/conf/settings.xml
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T00:03:14+05:30)
Maven home: /usr/share/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-66-generic", arch: "amd64", family: "unix"
Here's a part of my plugin's pom.xml file:
<properties>
<confluence.version>6.14.0</confluence.version>
<confluence.data.version>6.14.0</confluence.data.version>
<amps.version>8.0.2</amps.version>
<plugin.testrunner.version>2.0.1</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
I am using Confluence Server 7.2.0 and my plugin can be uploaded and run just fine.
But I can't seem to find any documentation that explains which versions of confluence will my plugin run on.
Looking at these links, however
https://marketplace.atlassian.com/apps/1210950/atlassian-plugin-sdk-windows/version-history
https://marketplace.atlassian.com/apps/1210991/atlassian-plugin-sdk-rpm/version-history
There seem to be different confluence versions supported for SDK version 8.0.16 for windows and the rpm versions of the SDK.
Also, it does not seem to mention the right SDK for building plugins for Confluence 6.7 to 6.13.
Is this the right page for such information? What am I missing?
When the atlas-sdk generates the plugin artifacts, it fills inside the pom file an enterprise version of Confluence as a starting point.
And in order to verify the plugin is working on other version, you will need to change the version in the pom file and restart the server and test your plugin manually to verify all its features are working properly.
Also to answer your inquiry for ATLAS-SDK compatibility with different Atlassian application versions. Each atlassian SDK version is backward compatible with its predecessor versions, which means if you have the latest Atlas-SDK then you may run any Confluence version you'd desire.
Hope this helps

Building Apache Roller on Windows 7

I am getting this kind of error when i tried to build apache roller on my windows 7 service pack 1 64 bit.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (gen-db-scripts) on project roller-webapp: An Ant BuildException has occured: Exception thrown by 'generator.parse'. For more information consult the velocity log, or invoke ant with the -debug flag.
[ERROR] around Ant part ...<texen outputFile="README.txt" controlTemplate="control.vm" outputDirectory="F:\roller-trunk\app/target/dbscripts" templatePath="F:\roller-trunk\app/src/main/resources/sql" contextProperties="F:\roller-trunk\app/src/main/resources/sql/dbscripts.properties"/>... # 5:261 in F:\roller-trunk\app\target\antrun\build-main.xml: F:\roller-trunk\app\target\dbscripts\db2\createdb.sql (The system cannot find the path specified)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (gen-db-scripts) on project roller-webapp: An Ant BuildException has occured: Exception thrown by 'generator.parse'. For more information consult the velocity log, or invoke ant with the -debug flag.
around Ant part ...<texen outputFile="README.txt" controlTemplate="control.vm" outputDirectory="F:\roller-trunk\app/target/dbscripts" templatePath="F:\roller-trunk\app/src/main/resources/sql" contextProperties="F:\roller-trunk\app/src/main/resources/sql/dbscripts.properties"/>... # 5:261 in F:\roller-trunk\app\target\antrun\build-main.xml
i suspect this outputDirectory="F:\roller-trunk\app/target/dbscripts" templatePath="F:\roller-trunk\app/src/main/resources/sql"` is the problem but i have no idea how to fix it. I ran the "mvn clean install" from my command prompt.
I succeeded building Roller source code in current SVN trunk (5.2.0-SNAPSHOT) on Windows 7 box without errors. output of mvn -version is following:
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T20:57:37+09:00)
Maven home: c:\apache-maven-3.3.3
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_45\jre
Default locale: ja_JP, platform encoding: MS932
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"
Could you try building with same version of JDK/Maven to the above output?
UPDATE
Now GitHub distribution of Roller can be built without this error. For detail check https://issues.apache.org/jira/browse/ROL-2086
GitHub doesn't store the empty directories that Roller needs to do the build, if this patch were applied (https://github.com/apache/roller/pull/3) the problem would be fixed.
My work-in-progress Github fork of Roller, TightBlog, already has this change in place: https://github.com/gmazza/tightblog. But TightBlog is not ready for regular use.
I believe this error happens because of direct pull from the Github version. At first, I've tried to pull it from Github and I faced the same problem. Later on, I've tried to checkout it directly from the SVN trunk and there's no problem with the building process.
I believe this error has also been described previously at http://comments.gmane.org/gmane.comp.java.roller.devel/5895. It is stated that there might be some problems with the Github version.

Maven: Release Plugin Does Not Commit Updated Versions

I am using the Maven release plugin. When I run
mvn release:prepare
I am prompted with the usual about the versions
What is the release version for "FOO"? (foo:bar) 1.10.99999:
What is the new development version for "FOO"? (foo:bar) 1.10.100000-SNAPSHOT:
The process completes normally. A tag is created and pushed to the correct repository as specified in the SCM tag:
<scm>
<connection>scm:git:git#top.secret.repo:foo/bar.git</connection>
<tag>HEAD</tag>
</scm>
But the updates to the versions numbers are not committed, and thus the SNAPSHOT, in the case the 1.10.99999-SNAPSHOT is deployed on mvn deploy. It appears others have had this issue as well but no real answer has been found
What is happening here and how do I fix it?
This is on Mac OSX. My Maven version is as follows:
$ brew info maven
maven: stable 3.2.5
http://maven.apache.org/
/usr/local/Cellar/maven/3.2.3 (76 files, 8.0M) *
Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/maven.rb
$ mvn --version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
Maven home: /usr/local/Cellar/maven/3.2.3/libexec
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"
In general: when facing issues with a specific maven-plugin, verify if you are using the latest version and try to upgrade first.
Updating the version from 2.3.2 to 2.5.3 solves the issue for me. Definitely, something isn't right with the 2.3.2 version of the maven-release-plugin

Why isn't maven replacing the environment variable for the maven-release-plugin release version?

I am trying to use the maven-release-plugin with some environment variables, but I get an issue when I use an environment variable for the release version.
I am executing:
mvn release:clean --batch-mode -Dtag=${env.tag} -Dproject.rel.com.mycompany.project:project-root=${env.project.rel.com.mycompany.project:project-root} -Dproject.dev.com.mycompany.project:project-root=${env.project.dev.com.mycompany.project:project-root} release:prepare
I am getting:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.4:prepare
(default-cli) on project project-root: Error parsing version,
cannot determine next version: Unable to parse the version string:
"${env.project.rel.com.mycompany.project:project-root}" -> [Help 1]
If I change the ${env.project.rel.com.mycompany.project:project-root} to a specific version, the command will pass.
But as you can see I am using:
${env.tag}
${env.project.dev.com.mycompany.project:project-root}
with no issues. Is this a bug? Or am I doing something wrong?
Additional notes:
Environment variables:
tag=2.55
project.rel.com.mycompany.project:project-root=2.55
project.dev.com.mycompany.project:project-root=2.56-SNAPSHOT
My Maven version is:
C:\>mvn -version
C:\>set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: C:\Users\John\Documents\apache-maven-3.0.4-bin
Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
Java home: C:\JDK\jdk1.6.0_25\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
you will have to use the arguments attribute: http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#arguments
So in your context your cmd line will look like this (Note the double quotes as well):
mvn release:clean --batch-mode release:prepare "-Darguments=-Dtag=${env.tag} -Dproject.rel.com.mycompany.project:project-root=${env.project.rel.com.mycompany.project:project-root} -Dproject.dev.com.mycompany.project:project-root=${env.project.dev.com.mycompany.project:project-root}"
Furthermore, if i remember right the uses of the tokens ${env.X} requires the usage of the property name in upper case (to be verified)
It's not working because the release plugin clears the environment[1]. I doubt it's documented[2], I found out by looking at the source. Farid's answer is a good workaround - it passes the environment value via java properties which are not cleared.
I would have simply commented on Farid's answer but SO doesn't think I'm shiny enough.
Why??
Classic maven.

Categories

Resources