Spring Tool Suite (STS) not downloading Maven Dependencies automatically after starting Spring Starter Project in Mavericks - spring

Our Spring Tool Suite (STS) not downloading Maven Dependencies automatically after starting Spring Starter Project with Web Style.
We are using:
Spring Tool Suite
Version: 3.6.1.RELEASE
Build Id: 201408250818
Platform: Eclipse Luna (4.4)
Maven 3.2.3
This issue is only happening on a computer running Mavericks. Other computers running Mountain Lion seems to run fine.
We have already tried Update the Project, Refreshing, Rebooting, Re-opening STS, opening Preferences >> Maven >> Checking Download repository index updates on startup and Update Maven projects on Startup.
All without success. Anyone having the same issue? Thanks.

Related

Error while executing Simple Spring Boot Application in Spring Tool Suite

I have recently installed Spring Tool Suite 4.0.1 on Ubuntu 18.04 and tried to run hello world spring application but it gives the following compile-time error. I have searched on google a lot but cannot find the relevant info.
Error:
"Description Resource Path Location Type
Archive for required library: '/home/anshul/.m2/repository/org/springframework/spring-test/5.1.2.RELEASE/spring-test-5.1.2.RELEASE.jar' in project 'demo' cannot be read or is not a valid ZIP file"
It looks like the JAR file in your local Maven repository is corrupted. The easiest way to solve this is to completely wipe out the local Maven repo (delete everything under .m2/repository and kick off an Update Maven Project... in STS. That will trigger Maven to download the dependencies again.

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

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.

Deployment in Jboss fuse using Maven

I have created a Fuse integration project in developer studio 9.0.2 and I'm using jboss-fuse-karaf-6.3.0 as the runtime container.
I want to deploy this project using Maven, but not able to figure out -
How and where to give server URL, user name and password for the deployment ?
Does project gets deployed to fabric or karaf ?
Will appreciate if anybody can help with some pointers.
Thanks in advance.
Is that server running locally or remote?
Locally you can simply define the server in the servers view and then use Add context menu to deploy your project.
it gets deployed to Karaf
When building projects with Maven I use osgi:install and dev:watch commands (available in both JBoss Fuse and vanilla Karaf). The following setup works well for a development machine.
First build with Maven using install goal, so the artifact gets installed in local repository.
Then issue osgi:install (see Manual Deployment in JBoss Fuse docs) command in your container to install your bundle. Job done!
> osgi:install mvn:it.your.package/your-artifact/1.0.0
Once the bundle is installed you will see a message like
Bundle ID: 352
This is the ID of the bundle installed. Issue the following command:
> dev:watch 352
Watched URLs/IDs:
352
Now every time you rebuild with Maven, the bundle gets redeployed automatically.
Watch out some settings to be changed if dev:watch does not reload bundles on JBoss Fuse 6.3.0
edit: use -SNAPSHOT in your version with this setup. Regular versionsmay not redeploy correctly because the container sees the version is the same and may use previously loaded classes, thus causing classloading issues.

Spring Tool Suite finds spring-boot integration test configuration and does not start main application

I have a little struggle with Spring Tool Suite in combination with spring-boot.
I created a custom Maven spring-boot-web-application including several JUnit tests, one of this test is an integration test which has a configuration for the testapplication.
If I want to start the spring-boot-web-application via Spring Tool Suite ( run as -> Spring Boot Application ) the application does not start because both configurations ( src/main/java, src/test/java ) are found and conflict each other.
As soon I remove the test resources from the buildpath the application starts as expected.
Is there any setting in Spring Tool Suite to prevent the test resources are added to the classpath when starting the spring-boot-web-application?
Thank you in advance!
STS 3.6.4 has a bug in it that causes the classpath for "Run As >> Spring Boot App" on maven projects to include 'test stuff' (source folders and jar dependencies) to be on the runtime classpath.
The bug is a regression as it did not exist in 3.6.3. The bug is fixed already in master and the fix will be part of STS 3.7.0. You can get this fix today by updating your STS installation from the nightly update site:
http://dist.springframework.org/snapshot/IDE/nightly/
Open "Help >> Install New Software" and paste the above link in the "work with" field and then install the "Core" pieces. The installer will inform you that you already have these and will perform an upgrade instead.
After this upgrade is succesful, "Run As >> Boot App" should no longer have test stuff on the runtime classpath.

Mavenize Grails project not works in STS

I am using STS 3.6.1, Java 7, Grails 2.4.3.
When create a normal Grails project, it works good. However, my Grails project need to depends on other java projects, so I convert it to maven project. After that STS prompt error
Could not find the grails dependency file. This probably means that there is a bad dependency in the pom file.
java.lang.Exception
The maven grails project can be build in grails command.
How to resolve is issue? Or if there is walk around to let grails project depends on other Java project.

Resources