I was working on a maven project and this project is generating some weird file.
The file name are like:
[PROJECT]/target/classes.531226305.timestamp
[PROJECT]/target/classes.1241815416.timestamp
[PROJECT]/target/test-classes.-1983166104.timestamp
And the content of the file are only a .(dot) inside it. Anyone has any idea of how this is generated? Thanks!
Does the project use the scala-maven-plugin? The scala-maven-plugin adds ".<hashcode>.timestamp" to files in the target directory. It's used for the incremental compile feature that is available for that plugin.
Related
I am writing an automated testing project for school using maven and I need to implement CI to our project. Since Gitlab has its own CI, I decided to use it.
The problem is that the project itself is inside of a folder in a Gitlab repository. I created a branch for that project, but the branch main body includes the project folder, so when I create a gitlab-ci.yml file, it cannot find the POM.xml file in the folder. So my question is that is there a way to make the yml file recognize the POM file by adding some sort of variable to it?
I know there are "only:" and "changes:" keywords for the yml file but that doesn't seem like it will help recognize the pom file. Also manually pushing a yml file that is inside of the project folder does not help. I haven't tried moving the POM file because the project grade is also dependent on the quality of our commits, so I would rather not commit wildly.
Using
- mvn -f project/pom.xml compile
instead of -mvn compile in the build: section of the .yml file solved it for me. I was blind and didn't see that there was a help section in the log that already answered my question.
I have a project base on Ant build ,I want to change the build tool from Ant to maven,But there is a big problem .
I have a jar file in my project ,and it can be modified by multi developers.
The jar file is located on special system and there is text file beside it.
Every time each developer change the jar file ,he/she set the flag(is Editing?) inside the text file to true while editing the jar file.
When he/she finished editing the jar file,he/she set the flag inside the text file to false,and then copy it to lib folder in project.
How could I handle this process in maven repository ?
I am not very sure about the process. But you can try to use Maven Ant run plugin. I t will help you to mimic ant build.
If I have a Maven project, and someone is going to load the project by opening the pom.xml file in IntelliJ, is there anything I can put in the file or elsewhere in the project that will load project-specific coding styles into the IDE?
Not by importing from a pom only. What you can do is add some IntelliJ files to the source code management tool. Idea saves its project specific code styles into /.idea/codeStyleSettings.xml - it may just picks it up after you imported the project via maven/pom.xml. I think it does not hurt to add a few other files too. Here is my .gitignore for intellij 13.1.5:
target/
# intellij settings files:
.idea/artifacts/
.idea/dictionaries/
.idea/copyright/
.idea/inspectionProfiles
.idea/libraries/
.idea/scopes/
.idea/compiler.xml
.idea/uiDesigner.xml
.idea/vcs.xml
.idea/rebel_project.xml
.idea/dataSources.ids
.idea/workspace.xml
Everything else is under version control. (some developers dont like that - I know - just wanted to mention it)
With the Maven assembly plugin I know I can set the permissions of the files contained within my tar such as here. However can I use the plugin to set the permissions of the tar itself?
Maybe I should just the ant plugin but this is a little messy
I haven't tested this, but you might be able to use "exec-maven-plugin" to do this.
How to change permission of jar packaged by maven? I am using maven assembly plugin
"Use maven:exec plugin to execute chmod"
So the idea is that you would add another plugin to the pom.xml file that sets the permission on the tar itself.
The only drawback that I see is that you have to have the name of the file in the plugin xml code in the pom file. That's fine as I have that listed in in the maven-assembly-plugin. But the file extension is found in assembly.xml (.zip, or .tar-gz), so if you change the file extension in assembly.xml, you would have to remember to change it in the pom.xml file. Not a big hassle, but it might be easy to miss on your first review.
I was having an issue of reading CMYK JPEG images , and have used below url as reference for solving the issue.
http://www.randelshofer.ch/blog/2011/08/reading-cmyk-jpeg-images-with-java-imageio/
I have given the configuration org.monte.media.jpeg.CMYKJPEGImageReaderSpi in the file javax.imageio.spi.ImageReaderSpi under path /META-INF/services/javax.imageio.spi.ImageReaderSpi.
This works perfectly inside eclipse and the image reader is loaded successfully.
This file is not loading when deployed , i can find the folder and the file in the generated war file in my desired jar file inside lib folder, i guess i need to add it to java classpath.
Please help me to add to classpath or if there is any other issue with it.
You need to add this file as a static resource to your build lifecycle.
For Ant or Gradle you just need to write a simple copy task (Ant task, Gradle task), for Maven you can use Maven Resources Plugin.
After that your file should appears in your app package.