pom error - org.apache.maven.archiver.MavenArchiver.getManifes - maven

I am getting error in pom file - org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)
in my pom i am using maven-war-plugin 3.0.0 , IDE- STS , java 7

encountered the same issue after updating the maven-jar-plugin to its latest version (at the time of writing), 3.0.2.
Eclipse 4.5.2 started flagging the pom.xml file with the org.apache.maven.archiver.MavenArchiver.getManifest error and a Maven > Update Project.. would not fix it.
Easy solution: downgrade to 2.6 version
Indeed a possible solution is to get back to version 2.6, a further update of the project would then remove any error. However, that's not the ideal scenario and a better solution is possible: update the m2e extensions (Eclipse Maven integration).
Better solution: update Eclipse m2e extensions
From Help > Install New Software.., add a new repository (via the Add.. option), pointing to any of the following URLs:
https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/ or
http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
Then follow the update wizard as usual. Eclipse would then require a restart. Afterwards, a further Update Project.. on the concerned Maven project would remove any error and your Maven build could then enjoy the benefit of the latest maven-jar-plugin version.
Additonal notes
The reason for this issue is that from version 3.0.0 on, the concerned component, the maven-archiver and the related plexus-archiver has been upgraded to newer versions, breaking internal usages (via reflections) of the m2e integration in Eclipse. The only solution is then to properly update Eclipse, as described above.
Also note: while Eclipse would initially report errors, the Maven build (e.g. from command line) would keep on working perfectly, this issue is only related to the Eclipse-Maven integration, that is, to the IDE.

Upgrade your m2e extensions instead downgrade.
(In Eclipse IDE) From Help > Install New Software.., add a new repository (via the Add.. option)
Specify name for your plugin and add path http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
once you are done with installation, please restart eclipse and update your project.

Related

Importing old Play 2.3.4 project into IntelliJ gives SERVER ERROR: HTTPS Required

When importing a Play project (Play 2.3.4, Scala 2.11.4, sbt 0.13.5) into IntelliJ IDEA I get the following error message:
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/jline/jline/2.11/jline-2.11.pom
According to the latest IntelliJ docs, only Play versions 2.4 and later are supported. So I downloaded an old IntelliJ version from 2016 (2016.2.5), which should have worked because the project was in active development with this IDE version back then. After finding a this article stating the Maven repo has deprecated http in favor of https, I'm not sure if the IntelliJ version mismatch is even the cause of this issue. However, the build was ok in 2016, and now I cannot fix this problem even if I create a settings.xml for Maven as described here... I still get the same error. I also tried to enable the "Override" setting in IntelliJ->Preferences->Build->Build Tools->Maven->User Settings File and pointed it to a settings.xml copy in a different folder. In both IntelliJ versions (2019.3.3 and 2016.2.5) I installed the Scala plugin directly in the IDE.
What am I doing wrong? How can I get IntelliJ to use the mirrors from my custom settings.xml?
Command-line already ran only by overriding the sbt repository as shown in this answer, IDE-based build still didn't recognize this file.
Finally solved it by bumping the sbt version at least one minor version up, to >=0.13.6 (source), from then on sbt itself uses a secure connection to the Maven repository.

MULE 3.8.1 Hibernate 4.3.11 - org.hibernate.jpa.boot.archive.spi.ArchiveException: Could not build ClassFile

I am developing an application for MULE ESB CommunityEdition (3.8.1 version).
I have included (provided by MULE) SPRING 4.1.6.RELEASE in project.
For persistence layer I set up Hibernate 4.3.11.FINAL.
My code is based on this idea (https://www.ricston.com/blog/jpa-mule/).
So basically i have included in the project (besides MULE dependencies):
hibernate-entitymanager (4.3.11.Final)
hibernate-core (4.3.11.Final)
hibernate-jpa-2.1-api (1.0.0.Final)
spring-orm (4.1.6.RELEASE)
And everything was working perfectly fine until i started to use Java 8 API...
Whatever I do: any lambda, stream or anything I am still getting error:
org.hibernate.jpa.boot.archive.spi.ArchiveException: Could not build ClassFile
What I did until now:
tried to add org.javassist dependency (in version from 3.18.0-GA to 3-22.0-GA) - nothing happened,
tried to exclude org.reflections.0.9.9 dependency (mule is including that in some its core dependencies): also nothing happened
I spent on this about 5 hours I am really close to give it up... I really need hibernate cause this project will include many db operations
What else Can i Try to do?
Problem solved!!
I was using mvn dependency:tree to check if there are any org.javassist dependencies in project.
And there weren't...
Then I checked the folder: {mule_home}/lib/opt and there was an old version of org.javassist library!
So: I downloaded latest org.javassist jar and I put it in the {mule_home}/lib/user folder.
Now it works like a charm :)
Please check if your Anypoint Studio is pointing correct JDK.
Check below
Preference> Installed JRE >> It should have JDK 1.8 checked.

Netbeans project: how to add dependency without having a pom-file?

I'm trying to make an old Netbeans project run.
However, certain references are broken:
Normally, one would install mongoldb-java-driver by augmenting the pom-file accordingly, see: https://mongodb.github.io/mongo-java-driver/
However, this Netbeans project does not have a pom file (I don't know why).
How can I add the missing files and folders to the project without a pom-file?
You can try downloading the Netbeans 8.2 from Oracle directly as it will contain by default the maven plugin and in this case might solve your problem.

Maven plugin causes certain target folders not to be removed during clean

I am using the latest version of the cxf-xjc-plugin (https://cxf.apache.org/cxf-xjc-plugin.html) plugin, 3.1.0. This plugin generates Java classes for the given xsd files successfully. When I run a clean on the project, the target/generated-sources/java folder is left in place. I've simplified my POM to only use this plugin and the problem persists.
Older versions of the plugin do not do this as don't other similar plugins like jaxb2-maven-plugin.
I have looked at the projects POM and I don't see the clean plugin being configured to protect these files. What else could be going on to cause this?
What OS are you using? Could it be a permission issue where you built as root outside the ide once? I also saw this
Why doesn't Maven's mvn clean ever work the first time?

Maven 2 is Still Alive : Even after setting Maven3

And i got a requirement, converting a Maven 2 project to Maven 3. So i downloaded Maven 3.2.1 and edited the Maven path to 3.And also changed Maven installation in eclipse to point Maven 3.
But when i run my project in eclipse, it is still taking maven 2 plugins. Could you please help me with this ?
Versions are just versions, there's no real relation between the Maven version and the plugin version. Actually, the Maven team tried to keep the maven-plugins as much as possible compatible with Maven3.
https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Plugin+Compatibility+Matrix shows the list of maven plugins and from which version they can be used with Maven3. Only the Maven-site-plugin required a major release, since it had to adopt the reporting part which has been removed with Maven3.

Resources