Block jaxb2 schemagen from reforming your schemas if nothing has changed in the model - jaxb

nowdays I notice when I "mvn clean install" my project, shcemagen tends to add/remove spaces or slightly change the form of the generated schemas, meaning that my "git status" will always mark those files as modified.
Is there a way to avoid/fix that?
Thank you

Related

Feature file setup in cucumber

I have two questions about cucumber frame work.
1-My .features files are not converting into feature format and showing as plan text file even though it works fine and I can run my TestRunner.
2- I have saved my all TestRunner files into a package Runner but in TestRunner file I have to give full path of my feature file in order to run TestRunner. e.g features= "Features" not working but
features="C:\Users\FourStar1\eclipse-workspace\com.freeTourTest\src\main\java\Features2\Addusers.feature"
works.
Take a careful look at the casing of your directory and package names. It's important you are consistent with these. It makes it easier to spot mistakes. Using lowercase is recommended.
Additionally tests and test resources should be put under src/test/java and src/test/resources respectively. Feature files are resources and will not be copied over target if you put them under java.
I would suggest learning the maven project layout by heart. It makes everything easier then making up your own organization.

How to Remove Entity Completely in Liferay (include class in JAR file)

I am using Liferay 6.2 GA5 Community Edition.
Sample case I have 2 entities in my service.xml, let's say entity A & B.
When I run Service Builder then it will generate many JAVA files in my source code, and also generate JAR file located in
".\my-app\liferay-plugins-sdk-6.2\portlets\my-app-portlet\docroot\WEB-INF\lib\my-app-service.jar"
I open it with 7-zip, and I can see in package com.mycompany.myapp.model contains classes of entity A & B.
Then I try to remove entity A in service.xml, and I have removed the corresponding JAVA files generated in my source code, then I run Service Builder again, but inside my-app-service.jar, entity A is still exist.
How do I completely remove it from JAR file? because in my case, Service Builder will not remove it, although I have remove generated JAVA files manually.
ServiceBuilder is a code generator, thus it only generates new code.
If you want to get rid of the once generated code, there's a lot more than just the java classes to get rid of: Spring configuration, Hibernate configuration etc. are there as well for you to take care of. All of these will have to be deleted manually. And if the code still remains in the jar, good old ant clean (or whatever build environment you use) should get rid of the my-app-service.jar file (which you otherwise also can also just delete manually, so that it will be rebuilt next time a build process or ServiceBuilder runs)
I recommend searching for occurrences of A in all your project's files to see if you still find leftovers, because otherwise some component might complain at runtime that a declarated class can't be found.

JHipster: Generate an entity - how to?

When I
yo jhipster:entity MyEntity
the generated code is taking no notice of the MyEntity table definition in db-changelog-002.xml. For example, I am expecting the fields on the table to be listed in the generated html. Instead I am getting the 3 default fields for id, text and date.
The db-changelog-002.xml file has been generated by Liquibase using their instructions for generating it from a fresh start. It looks fine as far as I can tell. I put it into the \src\main\resources\config\liquibase directory, along with db-changelog-001.xml
How can I debug? Are my expectations incorrect?
If you are running in "hot reload" mode, then he Liquibase file should be generated, and the database schema should be updated. This the "normal" scenario, and it works surprinsigly well given how complex this task is.
However, the HTML page is not updated. No work has been done to implement this, but this would be a good idea, I'll have a look at it.

MonoDevelop: Any way to override resources / classes using projects?

Consider a solution has 2 projects: ProjectA and ProjectB (both are MonoTouch apps) and ProjectBase. ProjectBase contains the whole application, but Main.cs file (with the entry point) is located in ProjectA and ProjectB (which reference ProjectBase). This way, running any of A/B projects will boot up the application from ProjectBase.
Now, I want to override something for ProjectA only (it might be XIB file, image or a .NET class). Is there any way I can setup the solution so that the code and resources, produced by ProjectBase, are merged with the ones from ProjectA/ProjectB and the latter wins?
I found (probably a quirky and kinda-undefined-behavior-driven way) of overriding XIBs: I just put a XIB into ProjectA and ProjectB, name it the same as it was named in ProjectBase and them exclude it from ProjectBase. Although MonoDevelop compiles all items, it seems that the startup project's XIBs get priority, so that I see ProjectA-specific XIBs when I launch ProjectA and ProjectB-specific XIBs when I launch ProjectB. However, I am not sure it is the way it should behave, plus, from what I can see from build log, ALL projects get built yielding resources at the end.
P.S. I'm sorry if this has been asked previously, but I was not able to find the similar question on SO.
I was once trying to do this for a bunch of apps. I would have thought build order would be ProjectBase and then ProjectA, and the content copy system would be the same... Guess this means we are wrong.
You could do a few things.
A) Build your own program to copy resources which are marked for content. Would not be very hard, just need to read the .csproj files. XML parsing is easy enough in .NET. Run this program on post build. Would just have to be careful when doing builds such as to zip or to the device as I am not sure how it handles post-build events.
B) [This is what I did instead] If I expect to also make ProjectC, ProjectD ... ProjectN I instead made a program to generate my program... (Programception).
What it does, has ProjectBase, and ProjectTempalte. You enter your new project name into this program, say, "MyNewProject" and it will create the correct folder structure, write the correct csproj files, and update SLN file. ProjectTemplate has various placeholders in .csproj files like {PLACEHOLDER} which Programception would just go through and find/replace with my project name. Image files (and in your case XIB) are then only kept within ProjectA (B..C..N) unless I do not expect to try and override them in which case they would stay in ProjectBase. This is a lot easier with a XIBless application I would assume. I never use XIB's anyway.
Hope that helps!

CruiseControl.NET parameter passing

I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline parameter. Is there any built-in property?
Splitting the project to two projects seems like the right thing to do.
Specifically, split to to projects and add a Project trigger for the DML project.
This way if the table scripts are to be changed, both projects will be triggered and if only some DML statement changes, only the second project will be triggered.
In case both projects have common trigger then i recommend using a synchronization queue.
<queue name="Q_Synchronizer" duplicates="UseFirst" />
<project name="project1_name" queue="Q_Synchronizer" queuePriority="1">project stuff...</project>
<project name="project2_name" queue="Q_Synchronizer" queuePriority="2">project stuff...</project>
HTH

Resources