An ERROR occurred in archiving the artifacts - java

When I type "build*.jar" into Files to archive filed in Archive the artifacts, the warning red message "build*.jar' doesn't match anything: 'build' exists but not 'build*.jar" appears.
After I ignore it and build, the following ERROR occurred:
Archiving artifacts
ERROR: No artifacts found that match the file pattern "build\*.jar". Configuration error?
ERROR: 'build\*.jar' doesn't match anything: 'build' exists but not 'build\*.jar'
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE

If you want to totally ignore the artifact part, you can select the Do not fail build if archiving returns nothing option in Jenkins Post-build Actions > Archive the artifacts > Advanced settings.

Please check if build is a direct folder within your Jenkins Project workspace. For example if , target is a direct folder with your project workspace, target\*.jar will archive all the jars within the target folder. Also, please try clicking on the ? for more details

What's probably happening is that \ is escaping * and it's looking for literally the file named build*.jar.
I assume you are on Windows, hence you are using \ separator. However most Windows versions support /. Try that first:
build/*.jar
If that doesn't work, you can try escaping \ in the first place:
build\\*.jar

Related

Maven build failing due to unrecognized `--settings` option

In my Java projects building with maven, I have a a .mvn directory that contains a maven.config file. Content of that file is as follows:
--settings ./.mvn/local-settings.xml
The local-settings.xml holds authentication credentials for pulling from a private registry.
This setup worked fine up until yesterday. Now, the CI build (using maven:3-amazoncorretto-17) is failing with the following error message:
Unable to parse maven.config file options: Unrecognized option: --settings ./.mvn/local-settings.xml
Has there been a breaking change in the maven image I am using for building?
With the introduction of maven 3.9, there was a BREAKING CHANGE that affects the parsing of the maven.config file:
https://maven.apache.org/docs/3.9.0/release-notes.html#potentially-breaking-core-changes
Each line in .mvn/maven.config is now interpreted as a single argument. That is, if the file contains multiple arguments, these must now be placed on separate lines, see MNG-7684.
As pointed out by #khmarbaise in the comments, adding a newline in the maven.config works just fine and is even downwards compatible.
--settings
./.mvn/local-settings.xml

Changelog path resolving in Liquibase maven plugin

I've got one problem with liquibase-maven-plugin 4.2.2. If I specify the path to logs like it was before
changeLogFile= classpath:db/changelog/db.changelog-master.xml
I'm getting an error
Error Reading Changelog File: Found 2 files that match classpath:db/changelog/db.changelog-master.xml: jar:file:/Users/macbook/IdeaProjects/geek-study-eshop/shop-database/target/shop-database-1.0-SNAPSHOT.jar!/db/changelog/db.changelog-master.xml, file:/Users/macbook/IdeaProjects/geek-study-eshop/shop-database/target/classes/db/changelog/db.changelog-master.xml
I understand the reason for this error and it possible to resolve it by changing changeLogFile to target/db/changelog/db.changelog-master.xml. But in this case, I will have target\ prefix in filenames stored in DATABASECHANGELOG table. But I don't want that for some reasons. I want all file names there to be with prefix db/changelog/... or classpath:db/changelog/.... Is that possible to do that somehow without using logicFilePath attribute?
I found the solution! There is no way to change liquibase-maven-plugin behavior but it's possible to change maven phase on which we run liquibase:diff command. Simply use mvn clean compile liquibase:diff! We are doing diff after compilation and resource movement but before the jar packaging.

Android Studio - Resource Entry already defined

After compiling my Android application using the Android Studio (Beta), I have the following error:
Error:error: Resource entry background is already defined.
res\drawable-xhdpi-v4\background.9.png:0: Originally defined here.
This occurred when I had a image file called "background" in my res folder.
I then made a 9 patch version of it and pasted it in the same folder. This meant that there was 2 files with the same name. So I unsurprisingly I had this error.
However I now deleted all instances of the background image file (including the 9 patch version and original image) in my code and layout file and I still have this error.
You could try to do one of the following:
Clean and Build or gradle clean build assemble
Invalidate and restart Android Studio
1 Build > Clean Project
2 Build > Rebuild Project
I am using Android studio and I run exactly into the same issue and none of the answers I found on the web helped me solve the problem, including the previous one. So reading through all details of the error messages and found this lines:
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\user\AppData\Local\Android\android-studio\sdk\build-tools\android-4.4W\aapt.exe package -f --no-crunch -I C:\Users\user\AppData\Local\Android\android-studio\sdk\platforms\android-20\android.jar -M C:\Users\user\AndroidStudioProjects\DartsApp\app\build\intermediates\manifests\debug\AndroidManifest.xml -S C:\Users\user\AndroidStudioProjects\DartsApp\app\build\intermediates\res\debug -A C:\Users\user\AndroidStudioProjects\DartsApp\app\build\intermediates\assets\debug -m -J C:\Users\user\AndroidStudioProjects\DartsApp\app\build\generated\source\r\debug -F C:\Users\user\AndroidStudioProjects\DartsApp\app\build\intermediates\libs\app-debug.ap_ --debug-mode --custom-package com.dartstransit.dartsapp -0 apk --output-text-symbols C:\Users\user\AndroidStudioProjects\DartsApp\app\build\intermediates\symbols\debug
Error Code:
1
Output:
res\drawable-hdpi-v4\bus_w.png:0: error: Resource entry bus_w is already defined.
res\drawable-hdpi-v4\bus_w.jpg:0: Originally defined here.
As you can see there are two files of name bus_w with different extensions on the same folder. I had already removed those files from the project and still getting the error, so I decided to check every single folder of the project that was reference in the compiler line in the error message. Finally found that there was a copy of the file bus_w.png in the folder app\build\intermediates\res\debug\drawable-mdpi-v4.
I just deleted it and voila, problem solved.
A simple Build > Rebuild project helped me
Did you try rename this file to other name? It seem one of your libraries have same resource.
I see that many devs(include me) had issue with ic_launcher too. I think you want to try mipmap instead drawable. So we will have something like this:
\res\mipmap-hdpi
\res\mipmap-mdpi
\res\mipmap-xhdpi
\res\mipmap-xxhdpi
Hope this help.
I have also encountered this error recently.Here is my solution that works,hope it will help you.
1.only keep 9 patch version image in the drawable-hdpi folder
2.make sure the code related to this problem in xml file remains the same: android:background="#drawable/msg_left"
instead of using the code:
android:background="#drawable/msg_left.9"
PS:My original image name is msg_left,and my 9 patch version image name is msg_left.9
I did the trick by moving the icon
drawable/ic_launcher
to
mipmap/ic_launcher
and it worked fine :)
In my case the problem was that I had more than one '.' in the filename. like:
a.png
a.bold.png
Solution was to rename to
a.png
a_bold.png
In our case, problem started occurring (error shows 'duplicate value for resource' in a library) when some other library was upgraded to it's latest version.
We just downgraded the version of the library that was upgraded.
Real pain was because that we have many dependencies which can be dynamically upgraded when there is a new version available in repositories. So my teammate had to go through all libs that can be dynamically upgraded and see if there is one that is recently upgraded, try to downgrade it and check if build goes fine. He identified many were upgraded on previous day. Downgrading one of them got the build back.
Conclusion we made is not to use Dynamic Versioning. Don't use dynamic versions for your dependencies.
This was the error by the way:
Task :app:generateDebugResources UP-TO-DATE
AGPBI: {"kind":"error","text":"error: duplicate value for resource \u0027attr/itemBackground\u0027 with config \u0027\u0027.","sources":[{"file":"/Users/unknownuser/.gradle/caches/transforms-1/files-1.1/singledateandtimepicker-1.2.2.aar/86ae3786d70c769e610c8a01d58aa638/res/values/values.xml","position":{"startLine":15,"startColumn":4,"startOffset":2427,"endColumn":48,"endOffset":2471}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource previously defined here.","sources":[{"file":"/Users/unknownuser/.gradle/caches/transforms-1/files-1.1/singledateandtimepicker-1.2.2.aar/86ae3786d70c769e610c8a01d58aa638/res/values/values.xml","position":{"startLine":15,"startColumn":4,"startOffset":2427,"endColumn":48,"endOffset":2471}}],"original":"","tool":"AAPT"}
Task :app:mergeDebugResources FAILED
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
FAILURE: Build failed with an exception.

The command line is too long. in java project with maven

I have maven-gwt project. It has lots of dependencies which is usual by a large project. I think it is at the limit with creation of classpath. I found some information about the limitation. Allowed is 1023 Character. But I need the libraries.
I receive the following error when i want to package my project mit Maven.
The command line is too long.
How can I get around the problem.?
Here is the expanded error in Jenkins:
[INFO] --- maven-surefire-plugin:2.5:test (default-test) # MyProject ---
[INFO] Surefire report directory: C:\Documents and Settings\User\.jenkins\workspace\Myproject\target\surefire-reports
The command line is too long.
The command line is too long.
[ERROR] There are test failures.
I found another workaround here http://code.google.com/p/gwt-maven/issues/detail?id=88
(I have problem with changing pom to fit a specific OS)
In short: make path to local repository as short as possible.
"
Comment 40 by gaurav.a...#gmail.com, Mar 23, 2009
One of the fix to the problem of "GWT compilation fails due to- The input line is
too long." is as follows:
Change m2(maven) repository. You might have your maven
repository at:
C:\Documents and Settings\MahcineNameABC\.m2
Copy settings.xml file from folder
apache-maven-2.0.8\apache-maven-2.0.8\conf into C:\Documents and Settings\MahcineNameABC\.m2
In settings.xml:
change the tag as
<localRepository>M:</localRepository>. Now your m2 home is a virtual M drive.
Create a repository folder as D:\maven-2.0.8\repository
Cut/Copy all the files/folders from C:\Documents and Settings\MahcineNameABC\.m2\repository to D:\maven-2.0.8\repository
Map local drive: open command prompt and execute (to create the
virtual drive):
subst M: D:\maven-2.0.8\repository(help)
Now a virtual M drive will point to your repository.
Set environment variable M2_REPO with value M:
To enable long inputs, on command prompt execute:cmd /e:32768
This would fix the problem of long inputs due to very long entries in classpath
variables, at least in Win XP SP2. The inputs are combined and tested from comment#22
and #7.
Hope it helps!
This should help in most cases (and 'til the end of project - at least in my case)
This seems to be a known problem with gwt-maven. There is a discussion on the gwt-maven google groups: Workaround for windows command line length limit
The problem seems to be that the sources are included on the test classpath, hence you're getting problems when you're running surefire:
The workaround is to exclude the sources dependency, make it system scope (from the above thread):
<dependency>
<!-- non existant artifact ID required (-source) maven bug?? -->
<artifactId>myproject-rpc-source</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<classifier>sources</classifier>
<!-- hack below as maven only incudes provdied in test scope -->
<scope>system</scope>
<systemPath>${basedir}/../rpc/target/myproject-rpc-${project.version}-sources.jar</systemPath>
</dependency>
but I would fully read and understand the google groups thread before proceeding with this.
If you are using Intellij there is a setting in workspace.xml that takes care of this issue. There is an existing post about this.
From 2.5.0-rc1 the GWT Maven plugin has a new option: "genParam". Set this param to false to aviod this problem.

how to add plug in dependency in eclipse

I want to know why and how to add a plug in dependency for any project in eclipse.
Plug-in Dependencies from the Eclipse Documentation Archives
Hope this helps.
Click on the project , choose properties, go to Java Build Path .. add jars or add external jars should solve your problem.
How to Resolve What Plugin to Add to the Dependencies
I needed to know what dependency to add (to an Eclipse Plug-in) as well as how to add it. The errors I got in the Java code were:
The type org.eclipse.jface.text.source.Annotation cannot be resolved. It is indirectly referenced from required .class files
in the java 'package' statement and:
The hierarchy of the type JavaDecodePlugin is inconsistent
To find what plugin supplied the Annotation class I searched the 'plugins' directory of the where the Eclipse code was installed on my (windows) machine (\app\androidDev\eclipse) for a reference to that class:
C:\app\androidDev\eclipse\plugins>grep -r org.eclipse.jface.text.source.Annotation *
Binary file org.eclipse.jface.text_3.8.2.v20121126-164145.jar matches
Binary file org.eclipse.text_3.5.200.v20120523-1310.jar matches
it was referenced in two plugins/jars. I searched the jars for the desired class. The first plugin/jar didn't contain it, the second did.
C:\app\androidDev\eclipse\plugins>jar -tf org.eclipse.jface.text_3.8.2.v20121126-164145.jar |grep Annotations
org/eclipse/jface/text/link/LinkedPositionAnnotations.class
org/eclipse/jface/text/source/projection/ProjectionSupport$ProjectionAnnotationsPainter.class
C:\app\androidDev\eclipse\plugins>jar -tf org.eclipse.text_3.5.200.v20120523-1310.jar |grep Annotations
org/eclipse/jface/text/source/Annotation.class
org/eclipse/jface/text/source/AnnotationMap.class
org/eclipse/jface/text/source/AnnotationModel$1.class
org/eclipse/jface/text/source/AnnotationModel$2.class
org/eclipse/jface/text/source/AnnotationModel$AnnotationsInterator.class
org/eclipse/jface/text/source/AnnotationModel$InternalModelListener.class
org/eclipse/jface/text/source/AnnotationModel$MetaIterator.class
org/eclipse/jface/text/source/AnnotationModel$RegionIterator.class
org/eclipse/jface/text/source/AnnotationModel.class
org/eclipse/jface/text/source/AnnotationModelEvent.class
So I knew what plugin I needed now. As Plug-in Dependencies shows (as in the answer above) You need to go to 'Package Explorer' expand 'META-INF', open 'MANIFEST.MF', open the 'Dependencies' tab and click the 'Add' button on the 'Required Plug-ins' section, type part of the name of the plug-in in the 'Select a Plug-in text area, let it find the fullname of the plugin (perhaps select the desired plugin) and click Ok.
(This answer is somewhat to document the process so if I have to do this again after I forget what I did, I, and you, will know)

Categories

Resources