spring-boot maven plugin re runs compile & test phase - maven-plugin

Using the spring-boot-maven-plugin both the run and repackage goal cause my compile and test stage to be re ran e.g.
mvn clean package spring-boot:run
and you see two compile and test runs...
in the maven debug out put I can see
...
[DEBUG] Goal: org.springframework.boot:spring-boot-maven-plugin:1.0.2.RELEASE:repackage (default)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<finalName default-value="${project.build.finalName}"/>
<outputDirectory default-value="${project.build.directory}"/>
<project default-value="${project}"/>
</configuration>
[DEBUG] --- init fork of myapp:1.0-SNAPSHOT for org.springframework.boot:spring-boot-maven-plugin:1.0.2.RELEASE:run (default-cli) ---
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile, test]
[DEBUG] -----------------------------------------------------------------------
And looking at the plugin source code classes, RunMojo amd RepackageMojo I see
#Mojo(name = "run", requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.TEST)
#Execute(phase = LifecyclePhase.TEST_COMPILE)
public class RunMojo extends AbstractMojo {
Thinking that the #Execute has something to do with it ?
Thanks

Yes. Why don't you just use "mvn spring-boot:run"? As far as I know, that's just the way Maven works.

My bad...it is actually the cobertura plugin doing this which is understandable as it needs to recompile the source to instrument it for coverage.

Related

Flutter Hive - Dead Lock ! code needs an Adapter class to run. but that Adapter class will be creatd after i run the code succesfully, in terminal

im new to programming, and english is my 2nd language, so please bypass any mistakes.
The instructor ran the build command in Terminal of IDE:
flutter packages pub run build_runner build
or if in above fails, he usually runs below command:
flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs web
but when i do the same error messages are generated.
error message:
This builder requires Dart inputs without syntax errors.
A function body must be provided.
Error Message in Terminal
E:\android\meter_switch>flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 711ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 124ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build...
[SEVERE] hive_generator:hive_generator on lib/bank_account.dart:
This builder requires Dart inputs without syntax errors.
However, package:meter_switch/bank_account.dart (or an existing part) contains the following errors.
bank_account.dart:8:3: A function body must be provided.
Try fixing the errors and re-running the build.
[INFO] Running build completed, took 1.4s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 91ms
[SEVERE] Failed after 1.5s
pub finished with exit code 1
1. before terminal command image1
2. my code - after terminal - RUN section showed this error
3. my code - after terminal command image2
Ok issue solved.
its same issue as : A function body must be provided. Try adding a function body
the issue was "A function body must be provided."
I just had to put a semi-collan at the end, after writing out the constructor of a class.
the base of whole issue was that I was just Too sure that the issue would not be in that specific file. And the surity that i would never forget a semicolan meade me fall into this abyss of ignorance.
I had looked at the stackOverflow page (link given above), but i never tried it out.

How to avoid mvn cobertura plugin affecting xpath return type in apache camel route

I am using apache camel 2.12.0 (tried also 2.14.0).
I have a route where I receive xml from remote server:
<?xml version='1.0' encoding='UTF-8'?>
<response><meta><code>200</code></meta><data><person><name>John</name></person></data></response>
from("direct:start")
.to("jetty:http://localhost/something")
.transform().xpath("/response/data")
.log("${body.class}")
.unmarshal().xstream();
I cut out body of unmarshal it. using xstream.
.log("${body.class}") -> net.sf.saxon.dom.DOMNodeList
Until now all works fine. mvn test, mvn camel:run.. all fine.
Now the error part
mvn cobertura:cobertura throws exception
org.apache.camel.InvalidPayloadException: No body available of type: java.io.InputStream but has value: [net.sf.saxon.tree.tiny.TinyElementImpl#90400f] of type: java.util.ArrayList on: Message: [net.sf.saxon.tree.tiny.TinyElementImpl#90400f]
.log("${body.class}") -> java.util.ArrayList
Help
Can you please give an advice why cobertura changes return type of xpath()?
UPDATE (solved)
I found the problem with dependencies.
If I use camel-xstream and cobertura, I get weird behavior in .xpath().
But if I include also camel-xmljson lib in the dependencies,then all works fine.
I suppose the one of the coberturas dependency to jaxen:jaxen:jar:1.1-beta-8:compile or some other one loads xml classes which collide with camel.

Generated assets not found play / scala framework

I'm new to scala. I'm trying to get this really interesting example from Matthias Nehlsen to work - github source.
I confirmed that I'm getting twitter data correctly (activator run). However, I'm not getting the generated public assets:
http://hostname:9000/angular/
Gives me this 404:
http://hostname:9000/assets/build/angular/birdwatch.js
http://hostname:9000/#
Gives me a 404 for this:
http://hostname:9000/assets/build/react-js/birdwatch.js
I am running using typesafe-activator 1.2.3 using: "activator run"
BirdWatch% activator run
[info] Loading project definition from ~/git/BirdWatch/project
[info] Set current project to BirdWatch (in build file:~/git/BirdWatch/)
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[info] a.e.s.Slf4jLogger - Slf4jLogger started
[info] application - Starting new client
On start (forgot to add, after a clean):
Compiling 13 Scala sources and 1 Java source to ~/git/BirdWatch/target/scala-2.10/classes...
[warn] /Users/NathanDunn/git/BirdWatch/conf/routes:6: unreachable code
[warn] GET /cljs-dev/ controllers.BirdWatch.indexCljs
[warn] /Users/NathanDunn/git/BirdWatch/conf/routes:9: unreachable code
[warn] GET /cljs/ controllers.BirdWatch.indexCljsOpt
[warn] two warnings found
I think that this is just indicating that the previous pattern subsumes the latter.
You Need to build the Clients.
Quoting the author :
The different clients are located in the clients/ folder, each of them needs to be built in order to work. Client build artifacts are no longer checked into the git repository in order to avoid bloating the repository size.
Have a look at their read me files:
You need Node.js, Grunt and Bower to build the angular client.
https://github.com/matthiasn/BirdWatch/tree/master/clients/angular
https://github.com/matthiasn/BirdWatch/blob/master/clients/react-js

Unable to deploy profile to JBoss Fuse 6.1 using fabric8:deploy

I am trying to deploy a simple Camel route to my local instance of JBoss Fuse 6.1 (GA release). I am trying to use the fabric8-maven-plugin to do so, but everytime I run fabric8:deploy, I receive the following error
Failed to execute goal io.fabric8:fabric8-maven-plugin:1.0.0.redhat-379:deploy (default-cli) on project filemover: Error executing: IO-Error while contacting the server: org.apache.http.NoHttpResponseException: The target server failed to respond
Here is my current plugin-definition from my pom file
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>1.0.0.redhat-379</version>
<configuration>
<profile>sample-filemover</profile>
<parentProfiles>feature-camel</parentProfiles>
<features>mq-fabric-camel</features>
</configuration>
</plugin>
My ~/.m2/user/settings.xml file contains the following server definition
<server>
<id>fabric8.upload.repo</id>
<username>admin</username>
<password>admin</password>
</server>
And I am executing the following mvn command
mvn fabric8:deploy -Dmaven.test.skip=true
(I realize I am skipping the tests, but I am trying to just deploy a profile at this time)
I can log onto the management console just fine and can see the root container no problem. Have I missed something in the configuration of Fuse to enable this?
I just spend some hours in the same problem.
Just change the version to 1.1.0.CR5 and you can deploy using mvn fabric8:deploy
Best Regards
are you sure you are trying on the correct server? Just put the fabric URL server where you want to deploy. I'm using that plugin version and it works correctly.
I know may be it's too late, but just for let you know, you can deploy in any server with
mvn clean fabric8:deploy -Dfabric8.jolokiaUrl=http://localhost:8181/jolokia
Cheers

m2eclipse - Mystery Build Failure on Package

I am using Eclipse 3.6 (Helios64) and m2eclipse 0.12.1.20110112-1712. I have a new project that only contains two classes that builds a jar. When I right click the project and select "Run As -> Maven package", I get the following error:
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # switch-provisioning-rest-client --- [INFO] Compiling 2 source files to C:\Devel\EclipseProjects\MyProject\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
javac: invalid flag: -s
...
[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.
When I set up a run configuration with the Goals "package -X", the project builds without error. If I run a configuration with the goal set to compile, it builds without error and I can then run "Maven package" successfully.
This is the only project I'm having issues with. All my other projects build sucessfully when doing a "Maven package".
There's nothing exceptional about the project pom.xml. It refers to the same parent pom as the other projects and contains its project specific dependencies.
Has anybody got any ideas what could be different about this project?
TIA!
This issue was answered on the m2eclipse mailing list:
http://dev.eclipse.org/mhonarc/lists/m2e-users/msg01818.html
Although my pom had 1.6 as the version, the project configuration hadn't been updated.
From: Benjamin Bentmann
This issue is not really specific to m2e but applies to mvn in general, as such the Maven user list might provide a better audience for help.
IIRC, the specific error means you trying to use a JDK 1.5 while you need JDK 1.6+ where the javac option in question was added. Assuming your project should actually compile against JDK 1.5, downgrading the maven-compiler-plugin version might also do, I would expect it started to use the -s option when the annotation processing support was added.

Resources