docker repository name component must match - spring-boot

I am trying to build my image using this plugin: https://github.com/spotify/docker-maven-plugin#use-a-dockerfile
When I run mvn clean package docker:build
I get this error:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (defa
ult-cli) on project demo: Exception caught: Request error: POST https://192.168.
99.100:2376/v1.12/build?t=DevOpsClient: 500: HTTP 500 Internal Server Error -> [
Help 1]
When I check the docker daemon logs, I see this:
Handler for POST /build returned error: repository name component must match \"[a-z0-9]+(?:[._-][a-z0-9]+)*\"" statusCode=500
Here is the doc for the naming convention: https://docs.docker.com/registry/spec/api/
Apparently you cannot have any upper case letters.
I am trying to build using Spring boot my following this guide: https://spring.io/guides/gs/spring-boot-docker/
I am using a SNAPSHOT release of spring boot and I have a directory named demo-0.1.1-SNAPSHOT. I believe this may be causing the problem.
Also I am working on windows and my project directory path is like:
C:\Users\myname\UserRegistrationClient\git\..... etc
Would this also affect the repository naming convention?
And how would I change it?

So this regular expression: [a-z0-9]+(?:[._-][a-z0-9]+)* doesn't include any upper case letters. So you should change your image name to devopsclient

Related

Maven tests run locally but fail in github action

I'm trying to run the basic maven java action listed here on my repo here: https://github.com/dhowe/rita2/
The mvn -B package --file pom.xml cmd runs correctly in my local repo, but the tests fails in the github action with the following error (full log here):
Exception: Cannot load dictionary at rita_dict.js /home/runner/work/rita2/rita2
So its clear that the dictionary resource is not being found when run via the github action. But why would the file (src/main/java/rita_dict.js) be found by maven locally, but not when run in the action ?
Switched to specifying the resource in /src/main/resources as suggested by P3trur0 (not sure why it wasn't working when specified as a resource in maven) after which builds work as expected

Sonar Qube code analysis failed with exist code 1

I am using sonar qube for code analyzer but getting error as below:
Preparing `SonarQube` scanner...
`realpath`: '': No such file or directory
ERROR in /opt/resource/out : line 85 with exit code 1
and not getting specific reason why it is failing.
You are missing some input in your configuration, most likely something with maven (default settings.xml pointing to wrong repo). Default maven install folder for concourse-sonarqube-resource is /opt/apache-maven. By using the debug flag, whole trace (mvn -X) will be shown and you get your specific reason.
type: sonar-runner
source:
host_url: ((sonarqube.url))
__debug: true

SonarQube - Unable to load component class

I keep receiving this issue (Build failure) when I add a random exclude in SonarQube.
I don't know why this occurs and it still throws a build failure irrespective of what what I exclude.
This used to work before I upgraded SonarQube from 7.4 to 7.5.
[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar
(default-cli) on project root: Unable to load component class
org.sonar.scanner.phases.AbstractPhaseExecutor: Unable to load
component class
org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader: Unable
to load component class
org.sonar.scanner.issue.ignore.pattern.IssueExclusionPatternInitializer:
Exclusions > Issues : Invalid format. The first field does not define
a resource pattern: ,squid:S00119,* -> [Help 1]
Fixed my issue by adding in SonarQube, not only the squid:S00119 but also the what file pattern to search for. I only added squid:S00119 and that is why it wasn't enough. You need also to specify what file.

Deploying Oracle Service Bus With Maven: Deploys Fine From One Directory But Fails From Another

I'm attempting to create an automated build and deployment for an OSB (Oracle Service Bus) composite. Such a system consists of two commands (run via command prompt from the directory in which the POM resides) after setting up Maven and the OSB plugin on the build server:
mvn package
mvn deploy -DoracleServerUrl=http://serverurl:port -DoraclUsername=username -DoraclePassword=password
This fails in the build system with the following exception:
The session cannot be activated due to the existence of conflicts.
But I believe, at it's core, this is because the build system creates the package with the first command during the build phase, and then deploys with the second command during the release phase.
If I take the code directly and run the two commands from the directory 1:
D:\OSBComposites\HelloWorldOSBService\HelloWorldOSBService
the commands run and the composite deploys fine.
If I literally copy the same code from Directory 1 to Directory 2 and run the same commands from directory 2:
D:\OSBComposites\HelloWorldOSBService\HelloWorldOSBService2
the second command fails with the same exception cited above.
This isn't a one-off situation either - I can recreate it dozens of times consistently. Running the commands from Directory 1 always succeeds while running the commands from Directory 2 always fails with the exception noted above.
And yes, this is a simple default HelloWorld composite - as simple as can be with no references to absolute paths.
Is there a cache in Maven or OSB that's "remembering" the original path from which the composite was first deployed or some other mechanism that prevents a composite from being deployed from a different location?
If your pom.xml resides in /path/directory1/pom.xml , your OSB project would get deployed as directory1 - redeploying as directory2 could then cause conflicts that you observe.
If you need to deploy it from a different location, you could place it in /path2/directory1/pom.xml
For your example, this should work:
Copy your project's content to the path similar to below and then run the maven deployment
D:\OSBComposites\HelloWorldOSBService2\HelloWorldOSBService

Running mule application in MuleStudio

While running mule application in MuleStudio, I see 2 options.
Run As > Mule Application
Run As > Mule Application with Maven
I always used first option which worked fine, until a point of time when I defined maven filter. Using the first option the filters were not getting resolved, so I tried to run using second option which resulted in the following error --
[12:04:57] Starting build...
Error: Could not find or load main class local
I created a test project for sharing this problem and uploaded it on github https://github.com/hshira/mule-mvn-filter
pom.xml > https://github.com/hshira/mule-mvn-filter/blob/master/pom.xml
Please suggest me, what is the right way to resolve filters in MuleStudio.
FYI ... the filtered property is resolved correctly if I build on terminal using mvn command
it could be issue with maven setup on your local machine.

Resources