Cannot deploy artifact to Nexus repository ,status: 401 Unauthorized - java

I have checked forums and I see that this question was asked before but a very long time ago.
I have a basic application and I am able to create artifacts with mvn package command.
[INFO] --- spring-boot-maven-plugin:2.3.5.RELEASE:repackage (default) # java-maven-app ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.324 s
[INFO] Finished at: 2022-05-10T11:03:24+02:00
Then I am trying to deploy it to remote Nexus Repo via mvn deploy command ,then I am facing with following error.
Failed to retrieve remote metadata com.example:java-maven-app:1.1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.example:java-maven-app:1.1.0-SNAPSHOT/maven-metadata.xml from/to nexus-snapshots (http://167.71.41.177:8081/repository/maven-snapshots/): authentication failed for http://167.71.41.177:8081/repository/maven-snapshots/com/example/java-maven-app/1.1.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized -> [Help 1]
I am able to login to Nexus repo with this user without any issue and I have following settings.xml in my mac.
<servers>
<server>
<id>nexus-snapshots</id>
<username>nexus</username>
<password>Krakow123</password>
</server>
</servers>
pom.xml
<?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.example</groupId>
<artifactId>java-maven-app</artifactId>
<version>1.1.0-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- to handle any Java version mismatch, add the following configuration for maven-compiler-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
<!-- https://mvnrepository.com/artifact/org.occurrent/subscription-api-blocking -->
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://167.71.41.177:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>5.0.0-alpha.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>org.occurrent</groupId>
<artifactId>subscription-api-blocking</artifactId>
<version>0.14.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testcontainers/elasticsearch -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.17.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.6.3</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.1.1</version>
</dependency>
</dependencies>
</project>
and I have following snippet from pom.xml ,everything should be fine actually ,anybody can help ?

Related

tomcat8-maven-plugin not found even after importing plugin in pom.xml

I added tomcat8-maven-plugin as a plugin to my pom.xml, but still when I run mvn tomcat8:run I get the following error back:
[ERROR] No plugin found for prefix 'tomcat8' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/v4g4x/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
POM.xml
<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.Varun.IWPL</groupId>
<artifactId>RESTTourism</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>RESTTourism</name>
<build>
<finalName>RESTTourism</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<properties>
<jersey.version>2.34</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Tomcat Version: 8.5.60
JDK Version: 8 & 11

Maven compiler plugin v3.8.1 only compiling 3 out of 198 classes

Tried to compile a maven project that up until now has always worked, but today when compiling it only compiled a small subset of classes.
I've tried changing the build settings but since the files are being fed to the input I can't understand why it's not being compiled.
The maven-status created and input files look like this:
input:
/home/nuno/IdeaProjects/MineWars/core/src/main/java/net/havocmc/gamemodes/minewars/core/vehicles/types/air/TieInterceptor.java
/home/nuno/IdeaProjects/MineWars/core/src/main/java/net/havocmc/gamemodes/minewars/core/ability/animations/ForceChokeAnim.java
/home/nuno/IdeaProjects/MineWars/core/src/main/java/net/havocmc/gamemodes/minewars/core/util/Skin.java
/home/nuno/IdeaProjects/MineWars/core/src/main/java/net/havocmc/gamemodes/minewars/core/vehicles/listeners/bukkit/EntityListener.java
...
created:
net/havocmc/gamemodes/minewars/core/mobs/listener/PlayerShootListener.class
net/havocmc/gamemodes/minewars/core/mobs/EntityManager.class
net/havocmc/gamemodes/minewars/core/mobs/configs/MobConfigManager.class
The maven compile log is:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for net.havocmc.gamemodes.minewars:core:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for org.spigotmc:spigot-1.12:jar should not point at files within the project directory, ${basedir}/../library/spigot-1.12.2.jar will be unresolvable by dependent projects # line 36, column 25
[WARNING] 'dependencies.dependency.version' for net.havocmc:Core:jar is either LATEST or RELEASE (both of them are being deprecated) # net.havocmc.gamemodes.minewars:MineWars:1.0-SNAPSHOT, /home/nuno/IdeaProjects/MineWars/pom.xml, line 106, column 22
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------< net.havocmc.gamemodes.minewars:core >-----------------
[INFO] Building core 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for net.havocmc.util.currency:GameModeUtils:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.havocmc.weapons:Weapons:jar:1.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.havocmc:Utilities:jar:1.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.havocmc:Core:jar:1.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.havocmc:Loot:jar:1.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 198 source files to /home/nuno/IdeaProjects/MineWars/core/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.297 s
[INFO] Finished at: 2020-08-13T19:06:05+01:00
[INFO] ------------------------------------------------------------------------
The project is structured like so:
Minewars
core
game
The minewars pom 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>net.havocmc.gamemodes.minewars</groupId>
<artifactId>MineWars</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>core</module>
<module>duels</module>
<module>game</module>
</modules>
<name>MineWars</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${project.basedir}</main.basedir>
</properties>
<build>
<defaultGoal>clean compile package install</defaultGoal>
<sourceDirectory>${basedir}/src/main/java/</sourceDirectory>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<artifactSet>
<excludes>
<exclude>org.spigotmc:spigot</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- For glowing (spectral effect) -->
<repository>
<id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository>
<!--Citizens-->
<repository>
<id>citizens-npcs</id>
<url>http://repo.citizensnpcs.co/</url>
</repository>
</repositories>
<dependencies>
<!-- This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.havocmc</groupId>
<artifactId>Core</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.havocmc.weapons</groupId>
<artifactId>Weapons</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.havocmc</groupId>
<artifactId>Loot</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<!--Citizens-->
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId>
<version>2.0.18-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.inventivetalent</groupId>
<artifactId>glowapi</artifactId>
<version>1.4.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
</exclusion>
<exclusion>
<groupId>org.inventivetalent.packetlistener</groupId>
<artifactId>api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>tmd-new-repo</id>
<url>sftp://192.99.55.236/var/www/html/repos</url>
</repository>
</distributionManagement>
</project>
the core pom 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">
<parent>
<artifactId>MineWars</artifactId>
<groupId>net.havocmc.gamemodes.minewars</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>core</artifactId>
<repositories>
<!-- Protocol Lib -->
<repository>
<id>dmulloy2-repo</id>
<url>http://repo.dmulloy2.net/content/groups/public/</url>
</repository>
<repository>
<id>md_5-public</id>
<url>http://repo.md-5.net/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<!-- For NMS access -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.12</artifactId>
<version>1.12</version>
<systemPath>${basedir}/../library/spigot-1.12.2.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>net.havocmc.util.currency</groupId>
<artifactId>GameModeUtils</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib-API</artifactId>
<version>4.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>LibsDisguises</artifactId>
<version>9.9.7</version>
<scope>provided</scope>
</dependency>
<!--Weapons-->
<dependency>
<groupId>net.havocmc.weapons</groupId>
<artifactId>Weapons</artifactId>
<version>1.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--Utils-->
<dependency>
<groupId>net.havocmc</groupId>
<artifactId>Utilities</artifactId>
<version>1.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<defaultGoal>clean compile package install</defaultGoal>
<sourceDirectory>${basedir}/src/main/java/</sourceDirectory>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Fixed, was a problem with an import that might have been causing issues? I don't really know why, just that it worked when I removed it.

JavaFX Maven Compile Error

Maven cant build my JavaFX Project, its runs perfectly fine via Intellij. It cant find all the JavaFX packages.
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 10 source files to /home/christian/Projects/timetracking-converter/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/christian/Projects/timetracking-converter/src/main/java/com/mayobirne/controller/ConverterController.java:[8,25] error: package javafx.application does not exist
it shows an error for all JavaFX-related imports
this is my POM:
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mayobirne</groupId>
<artifactId>timetracking-converter</artifactId>
<name>timetracking-converter</name>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>mayobirne</name>
</organization>
<properties>
<slf4j.version>1.7.12</slf4j.version>
</properties>
<build>
<finalName>timetracking-converter</finalName>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.3.0</version>
<configuration>
<mainClass>com.mayobirne.MainApp</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>com.mayobirne.MainApp</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- MigLayout -->
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-javafx</artifactId>
<version>5.0</version>
</dependency>
<!-- Apache Commons -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- EXCEL -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
</dependencies>
Project is available on Github: https://github.com/mayobirne/timetracking-converter

i can't solve maven building error failure

I get a error when I use maven to build my project.so please help!
thank you for your help
Failed to execute goal
org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly
(make-assembly) on project newstart-app-ithelp: Execution
make-assembly of goal
org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed:
For artifact {null:null:null:jar}: The groupId cannot be empty. cause
: Execution make-assembly of goal
org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed:
For artifact {null:null:null:jar}: The groupId cannot be empty. Stack
trace : org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal
org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly
(make-assembly) on project newstart-app-ithelp: Execution
make-assembly of goal
org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed:
For artifact {null:null:null:jar}: The groupId cannot be empty.
<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">
<parent>
<groupId>com.feinno.app</groupId>
<artifactId>root-pom</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>newstart.app</groupId>
<artifactId>newstart-app-ithelp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>newstart-app-ithelp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.newstart.app.ithelp.ITHelpBean</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.feinno.app</groupId>
<artifactId>feinno-app-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.24</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>0.2.9</version>
</dependency>
<dependency>
<groupId>spring-aop</groupId>
<artifactId>spring-aop</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-beans</groupId>
<artifactId>spring-beans</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-context</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-core</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-jdbc</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-tx</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>spring-expression</groupId>
<artifactId>spring-expression</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>IKAnalyzer</groupId>
<artifactId>IKAnalyzer</artifactId>
<version>6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>linq4j</groupId>
<artifactId>linq4j</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://10.10.208.92:8081/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
I have fixed this issue by deleting local .m2/repository folder. The build is successful now.
And mine has a different solution. I had a POM that had a <dependencyManagement> entry for the jar without any <version>, and it had a <dependencies> entry for the jar with a <version>. Plus, the parent POM had a <dependencyManagement> entry with the same <version>. Apparently this confused Maven (3.3). The build worked fine, but the packaging did not.
Fix: remove <dependencyManagement> entry in the child POM, and remove the <version> from the <dependencies> entry in the child POM.
In code, here is the broken situation:
Parent pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Child pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
...
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
</dependencies>
Post fix: parent POM is the same, child pom has just this
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
If you look at your maven build output, there should be some warnings that say .pom is invalid, transitive dependencies (if any) will not be available. Delete all the artifacts corresponding to those poms and rebuild, you need not delete the entire repository.
recently I stuck with the same problem. I turns that assembly-plugin doesn't propagate/report errors with dependencies:
[DEBUG] Resolving project dependencies transitively.
[DEBUG] com.g.....0.4-SNAPSHOT (selected for null)
[DEBUG] org.springframework:spring-expression:jar:3.1.4.RELEASE:compile (selected for compile)
[DEBUG] org.springframework:spring-asm:jar:3.1.4.RELEASE:compile (selected for compile)
[DEBUG] trove:trove:jar:1.0.2:compile (selected for compile)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
....
[INFO] p.....mo ....................................... FAILURE [57.144s]
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.4:single (full) on project p...o: Execution full of goal org.apache.maven.plugins:maven-assembly-plugin:2.5.4:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1]
that's all what I've got from assembly-plugin. eg. compiler warns about the broken stuff:
[WARNING] error reading /var/lib/jenkins/...org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar; error in opening zip file
[WARNING] error reading /var/lib/jenkins/.../org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar; error in opening zip file
Thus, if you've been stuck in this trouble, invoke mvn dependency:tree to troubleshoot the dependency.
I recently came across this building a spring boot 2.2 project.
Turns out the problem was an out of date maven-assembly-plugin. Our build specified 2.3 but spring boot's bom requested at least 3.1.1. Bumping to 3.2.0 (the latest at time of writing) fixed the problem.
Check your Maven version.
I had the same problem and nothing worked until I downloaded and installed a later version of Maven (from 3.2 to 3.6). This solved the issue for me.
Also I was using Java 11 and from what I see here:
https://mkyong.com/maven/how-to-install-maven-in-windows/
Maven 3.3+ requires JDK 1.7+
Maven 3.2 requires JDK 1.6+
Maven 3.0/3.1 requires JDK 1.5+
For me temporarily removing the following dependency from the plugin management section solved it for me.
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
</plugin>
The previous error message:
Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:2.8.1:display-plugin-updates failed: For artifact {null:null:null:jar}: The groupId can not be empty. -> [Help 1]
In my case the problem was that Maven was unable to download the artifactories on its own during the build phase. So I have to run,
mvn clean install
explicitly and it worked perfectly.

Datanucleus enhance using Maven in GAE, Build Failure

I referred to article as here which defines how to enhance a class for data nucleus. I am trying to do the same using Maven but keep on getting build failure
DataNucleus Enhancer (version 3.2.7) for API "JPA" using JRE "1.7"
DataNucleus Enhancer : Classpath
>> E:\DevTools\apache-maven-3.1.0\bin\..\boot\plexus-classworlds-2.4.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.262s
[INFO] Finished at: Fri Sep 27 22:41:16 IST 2013
[INFO] Final Memory: 17M/227M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.datanucleus:datanucleus-maven-plugin:3.2.0-m2:enhance (default) on project rho_v1.0: Error executing DataNucleus tool org.datanucleus.en
hancer.DataNucleusEnhancer: InvocationTargetException: org.datanucleus.metadata.AbstractMemberMetaData.setPersistenceModifier(Ljava/lang/String;)V -> [Help 1]
[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/MojoExecutionException
My POM file is as below
<?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>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.sis.rho</groupId>
<artifactId>rho_v1.0</artifactId>
<properties>
<appengine.app.version>1</appengine.app.version>
<appengine.target.version>1.8.3</appengine.target.version>
<datanucleus-core.version>3.2.7</datanucleus-core.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.target.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${appengine.target.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${appengine.target.version}</version>
<scope>test</scope>
</dependency>
<!-- Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8</version>
</dependency>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
</dependency>
<!-- Struts 2 + Spring plugins -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.1.8</version>
</dependency>
<!-- Javax persistence -->
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>${datanucleus-core.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-enhancer</artifactId>
<version>3.1.0-release</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>2.1.1</version>
</dependency>
<!-- for log4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<!-- struts 2 velocity dependency -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>2.5.1</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<archiveClasses>true</archiveClasses>
<webResources>
<!-- in order to interpolate version from pom into appengine-web.xml -->
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<jvmFlags>
<jvmFlag>-Xdebug</jvmFlag>
<jvmFlag>-Xrunjdwp:transport=dt_socket,address=8080,server=y,suspend=y</jvmFlag>
</jvmFlags>
<disableUpdateCheck>true</disableUpdateCheck>
</configuration>
</plugin>
<plugin>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-maven-plugin</artifactId>
<version>3.2.0-m2</version>
<configuration>
<api>JPA</api>
<fork>false</fork>
<persistenceUnitName>transactions-optional</persistenceUnitName>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Can anyone please help me understand what does that error means and how to avoid that error. Any help will be appreciated.
Since when has GAE supported DN 3.2.x ? https://code.google.com/p/datanucleus-appengine/wiki/Compatibility

Categories

Resources