What's "grails package" actually do? - debugging

I'd like to debug packing my grails project into war file by 'grails war' (because of an error described here: Can not build war from grails project) so I'm looking for differences in (ant?) commands which are executed step by step by 'grails package' (which my project does successfully) and 'grails war' in it's packaging section (which ends up with error: Error WAR packaging error: startup failed ).

Related

Jenkins maven target war

on my laptop i'm using maven-war-plugin to build me a war file that I later deploy to tomcat
now i'm trying to recreate this build process with Jenkins and the problem that when i set a maven target as war it returns an error msg
[ERROR] Unknown lifecycle phase "war".
how can I use war plugin on jenkins build process ?
Usually, you don't call the war plugin directly, but you call mvn clean install on a project with packaging war. This will trigger all necessary steps, including compilation and also the war plugin.
So put in clean install in your Jenkins and this should be fine.

Teamcity Issue :Unable to add module to the current project as it is not of packaging type 'pom'

I am trying to add Maven build step in TeamCity to generate Maven archetype.
mvn archetype:generate
This works fine in command prompt.
Unfortunately it throws below error in TeamCity:
Failed to execute goal
org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate
(default-cli) on project pso-jms-listener-archetype:
org.apache.maven.archetype.exception.InvalidPackaging: Unable to add
module to the current project as it is not of packaging type 'pom'
I created a new folder and tried executing it there, but still throws the same error
Any suggestions would help.
You may already have a POM file in the directory where mvn archetype:generate is executed.
For Maven, archetype is
a Maven project templating toolkit. An archetype is defined as an
original pattern or model from which all other things of the same kind
are made.
In short, you are creating a project (from a template) in an other project.
In your project folder, delete the file pom.xml and use mvn archetype:generate again.

How to create executable jar file from springboot - maven application?

When I tried to create a jar file using maven plugin in eclipse, I got thus error while trying to execute that jar:
Exception in thread "main" java.lang.IllegalStateException: Failed to
get nested archive for entry
BOOT-INF/lib/spring-boot-starter-actuator-2.0.3.RELEASE.jar
This seems to be a bug in 2017. Is there any solution for this now?
Your executable jar file doesn't contain above jar file.You should build jar with dependencies.
Right click project then click 'Run As'
Maven Build
And you should type 'package' in input area then run.
/path/your/project/target/ there is your .jar file with dependencies.

Can not deploy from maven after deploying using CLI on JBOSS

On our jenkins we have a build pipe that as a last step deploys the artifact (ear file in this case) to a remote JBoss 6.4 server. This works fine as long as I don't install that same ear file using tje JBoss cli on the server. After that Maven complains:
Failed to execute goal org.jboss.as.plugins:jboss-as-maven-
plugin:7.7.Final:deploy (deploy) on project caretrack-ear:
Deployment failed and was rolled back. "JBAS018785: There is
already a deployment called foo-ear-1.0-SNAPSHOT.ear with the
same runtime name foo.ear"
Found the problem.
Apparently as we build the assembly, used with the manual deploy, the ear file has a different name than the ear file built in the continuous integration pipe. Both try to deploy, different name but same runtime name.
The ear in the Assembly contained an ear with the version number still attached, while the ear in the ci-pipe had it's version number stripped.

maven-bundle-plugin: The defined artifact is not an archetype

I configured the "maven-bundle-plugin" from Apache Felix as a Maven Archetype in Eclipse (since it was missing), but when I try to create a new Maven project with it, I get as error:
Unable to create project from archetype [org.apache.felix:
maven-bundle-plugin:2.3.5 -> ]
The defined artifact is not an archetype
I then tried the same procedure with ops4j Pax (which is pre-configured in Eclipse), which seems to be something similar, and it worked, so I think I'm doing it right and the problem is with "maven-bundle-plugin".
What does the error message mean, and what can I do to fix it, or am I somehow getting this all wrong?
[EDIT] While I can create the project with ops4j Pax, I afterward get:
Project build error: Unknown packaging: bundle
which as apparently been fixed in 2009! So this obviously doesn't work either.
I finally had success with the following procedure:
cd workspace
mvn org.ops4j:maven-pax-plugin:create-bundle -Dpackage=demo.service
-DbundleGroupId=demo.service -DbundleName=demo.service-bundle
-Dversion=0.1
cd demo.service-bundle
mvn org.ops4j:maven-pax-plugin:eclipse
# Import project as Eclipse project
# (I haven't try to import it as maven project)
And btw, it took me about ages to work out why this doesn't work in a Windows batch file: that is because mvn is itself a batch file, and so you have to use "call".

Resources