Get "Error: unable to resolve '/assets/images/**.png' for transcoding" while building on FlexMojos 4.0-RC2 and Flex SDK 4.5.1.21328 - flex4.5

I get the this "Error: unable to resolve '/assets/images/**.png' for transcoding" while building on FlexMojos 4.0-RC2 and Flex SDK 4.5.1.21328. Code is like below
[Embed(source='/assets/images/lot_dimensions_bg_4digit.png')]
SDK version
<flex.sdk.version>4.5.1.21328</flex.sdk.version>
Flex Mojos version
<flex-mojos.version>4.0-beta-7</flex-mojos.version>
Thanks for any help.

You need to specifically add a dependency for flexmojos-threadlocaltoolkit-wrapper before
the compiler dependency.
See the following page for more details:
https://dev.c-ware.de/confluence/display/PUBLIC/Configuring+your+poms

I'm using the same version of the Flex SDK, but I'm using flexmojos 4.0-RC2. Embedded assets are working fine for me.
Make sure that when you build, you're copying the embedded assets over into target/classes. I had to include some special configuration for that.
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<debug>true</debug>
<configurationReport>true</configurationReport>
<sourceFile>com/example/MyApp.mxml</sourceFile>
<swfVersion>11</swfVersion>
<flexBuilderCompatibility>true</flexBuilderCompatibility>
<descriptorTemplate>${basedir}/${application.name}-app.xml</descriptorTemplate>
<!-- Here's the extra config -->
<includeFileSets>
<fileset>
<directory>src/main/resources/embedded</directory>
<includes>
<include>*.*</include>
</includes>
</fileset>
</includeFileSets>
</configuration>
</plugin>

Related

cargo-maven2-plugin:start fails with "Actually there are no valid types registered for this configuration", regardless of what containerId I enter

I'm trying to run integration tests with the cargo-maven2-plugin and Tomcat 8. I want the Maven build to start the container for me, so I have configured the start and stop goals as documented here. The problem is that regardless of what I enter as containerId, the start goal always fails with a message saying that there are no registered configurations. The error messages always ends in
Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
I've tried various configurations, including ones that I found in various tutorials, and ones that user older Tomcat versions, but nothing helps. The error message is always the same.
Other posts here on Stack Overflow recommend to update the Cargo versions, but this doesn't apply to my problem: I already use the latest release version (1.6.5).
So, why do I keep getting this error?
For reference, here is one complete configuration that I tried out:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.5</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.23</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
</configuration>
<deployables>
<!-- ... -->
</deployables>
</configuration>
</plugin>
The full error message for this configuration is:
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.5:start (start-container) on project domain.db.itest: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.6.5:start failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat8x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
The solution was incredibly simple: I had the offline mode enabled. Without offline mode, Cargo downloaded the cargo-core-container-tomcat artifact, and apparently this artifact contains the definition of the tomcat8x configuration. Then, the container start was successful!
I had started the Maven build from Eclipse, so I didn't notice that the offline mode was enabled. I'm aware that this situation is quite special, but maybe someone else still benefits from my insight. It took me a while to solve, so I'm sharing problem and solution here. (After all, this is encouraged :-)
I got the key hint from a mailing list post, where thecargo-core-container-tomcat artifact was not downloaded due to a Nexus repository configuration.
This error is sometimes due to the cargo plugin version. Update your cargo plugin to the higher or latest version.
In my case, I updated from cargo 1.4.8 to cargo 1.7.0.
check this link,its may help:
click here

Neo4j 3.0.x PostingsFormat with name 'BlockTreeOrds' does not exist

I tried updating from Neo4j 2.3 to 3.0.1. I can start up the database as a service, no problem there.
But when I try to build a Neo4j executable and run it, I find a bug which I cannot resolve. Under Neo4j 2.x I can build executables fine. Below is my main method:
public class StartDB {
public static void main(String[] args) {
new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(Paths.get(args[0]).toFile())
.loadPropertiesFromFile(args[1])
.newGraphDatabase();
}
}
I have a simple POM with 1 dependency:
<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
The command line arguments are the paths to my DB and config respectively.
Below is the stacktrace from this graph instantiation error.
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /home/glemmon/UPDB/data/neo4j-3.0.1/data/databases/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:144)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.initFacade(CommunityFacadeFactory.java:40)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:99)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$206(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$$Lambda$1/1313922862.newDatabase(Unknown Source)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)
at test.StartDB.main(StartDB.java:11)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine#5483163c' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:415)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:62)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:98)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:502)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:99)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:140)
... 7 more
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.PostingsFormat with name 'BlockTreeOrds' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [Lucene50]
at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:114)
at org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
at org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsReader.<init>(PerFieldPostingsFormat.java:258)
at org.apache.lucene.codecs.perfield.PerFieldPostingsFormat.fieldsProducer(PerFieldPostingsFormat.java:341)
at org.apache.lucene.index.SegmentCoreReaders.<init>(SegmentCoreReaders.java:104)
at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:65)
at org.apache.lucene.index.ReadersAndUpdates.getReader(ReadersAndUpdates.java:145)
at org.apache.lucene.index.ReadersAndUpdates.getReadOnlyClone(ReadersAndUpdates.java:197)
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:99)
at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:435)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:100)
at org.apache.lucene.search.SearcherManager.<init>(SearcherManager.java:106)
at org.apache.lucene.search.SearcherManager.<init>(SearcherManager.java:76)
at org.neo4j.kernel.api.impl.index.partition.IndexPartition.<init>(IndexPartition.java:54)
at org.neo4j.kernel.api.impl.index.AbstractLuceneIndex.open(AbstractLuceneIndex.java:101)
at org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider.indexIsOnline(LuceneSchemaIndexProvider.java:178)
at org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider.getInitialState(LuceneSchemaIndexProvider.java:123)
at org.neo4j.kernel.impl.api.index.IndexingService.init(IndexingService.java:200)
at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.init(RecordStorageEngine.java:403)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:405)
... 16 more
Since I can start the DB as a service using "bin/neo4j", I thought there must be a discrepancy between the files under /neo4j-community/3.0.1/lib and the files Maven is providing. I've tried running my executable with java -cp "/neo4j-community/3.0.1/lib/*" to no avail. Any help would be appreciated.
The most likely reason is that Maven is not including the Lucene jar file's META-INF/services into the compiled artifact:
META-INF/services/org.apache.lucene.codecs.PostingsFormat
org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat
org.apache.lucene.codecs.bloom.BloomFilteringPostingsFormat
org.apache.lucene.codecs.memory.DirectPostingsFormat
org.apache.lucene.codecs.memory.FSTOrdPostingsFormat
org.apache.lucene.codecs.memory.FSTPostingsFormat
org.apache.lucene.codecs.memory.MemoryPostingsFormat
org.apache.lucene.codecs.simpletext.SimpleTextPostingsFormat
org.apache.lucene.codecs.autoprefix.AutoPrefixPostingsFormat
As you can see, this is where the BlockTreeOrdsPostingsFormat is defined.
You can work round the problem by creating a shaded jar with a ServicesResourceTransformer, which will merge all the various META-INF/services from all the included jar files together.
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- add Main-Class to manifest file -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>...</mainClass>
</transformer>
<!-- merge META-INF/services -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Your maven dependency is not sufficient, change it to
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-community</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
update
maybe adding this one solves it:
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
<version>5.5.0</version>
</dependency>
could this be an encoding issue?
my build currently shows the exact same behavior.
it runs perfectly fine in eclipse but building a jar file drops this error.
my src files are encoded in utf8 as well as all the resources.
I noticed that the db itself and the compilations and jar will be ANSI though.
while creating the database works fine. using transactions on it will utterly fail.
I further noticed that using eclipse i have no charset issues but executing the jar from power shell will display faulty characters.
I also found a nullpointer exception where there shouldn't have been one when looking up a node in the db.
all strong indicators that this might be an encoding issue as the build file itself looks flawless.
sadly it would be quite an effort to convert all my files to ansi just to see if my hunch was correct but maybe this was of help.

Using Maven to build iOS

I am having issues with getting Maven to build out my iOS app. My plug in is set up like so:
<plugin>
<groupId>com.sap.prd.mobile.ios.mios</groupId>
<artifactId>xcode-maven-plugin</artifactId>
<version>1.14.0</version>
<extensions>true</extensions>
<configuration>
<settings>
<ARCHS>armv7 armv7s</ARCHS>
<ONLY_ACTIVE_ARCH>NO</ONLY_ACTIVE_ARCH>
</settings>
<sdks>
<sdk>iphonesimulator</sdk>
</sdks>
<configurations>
<configuration>Debug</configuration>
</configurations>
</configuration>
</plugin>
However, I'm getting the error:
The build has not been performed for default configuration 'Release' and default sdk 'iphoneos'
even though I'm trying to exclude Release by adding only the Debug configuration. What am I doing wrong here? I'd like to also build release, but I am trying to exclude it for now since it is giving me issues.
I've been stuck on this for about a month, sadly. So, any insight would be greatly appreciated.
Turns out there was a bug with version 1.14.0. Please update to version 1.14.1 of this xcode-maven-plugin to fix this issue.

maven-war-plugin overlay and m2e eclipse plugin

I'm trying to leverage the useful overlay feature of the maven-war-plugin.
In other words, I have a template (packaged as WAR file, template-0.0.1.war) containing tag files, css, js and images.
When I set template-0.0.1.war as a dependency of the myApp project I get a final myApp.war containing all the files of template-0.0.1.war overwritten by those with the same path in the myApp project.
This is the behavior I want.
However, I need to introduce in the pom.xml of myApp a configuration of the maven-war-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<webResources>
<resource>
<directory>../path/to/another/dir</directory>
</resource>
</webResources>
</configuration>
</plugin>
As soon as I introduce such a configuration of the plugin, I obtain the final myApp.war with all the files from both template-0.0.1.war and myApp project but the files of template-0.0.1.war overwrite those with the same path in the myApp project.
This behavior is exactly the opposite of what I expect.
Can someone tell me where I'm wrong?
Thanks in advance.
Edit after the solution was found:
The described issue is due to the concurrency of different actions: the WAR overlay (which works correctly) and the external webResources.
In fact, the external webResources tag points to the template project directory: totally unuseful for Maven, but indispensable to "fool" the m2e eclipse plugin and let it see the custom tags contained in the template.
The solution I have adopted is to introduce 2 different profiles in the plugin section of my pom.xml: the first one called "eclipse" in which I inserted the maven-war-plugin with the webResources and a second profile (called "standard" and activated by default) without the maven-war-plugin.
From the maven war plugin documentation:
By default, the source of the project (a.k.a the current build) is added first (e.g. before any overlay is applied). The current build is defined as a special overlay with no groupId, artifactId. If overlays need to be applied first, simply configure the current build after those overlays.
If you have files in the template that are being overwritten by files in the child WAR, you may want to consider explicitly excluding them in the overlay configuration.
Here's what the documentation says to apply the overlay first:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<overlays>
<overlay>
<groupId>com.example.projects</groupId>
<artifactId>my-webapp</artifactId>
</overlay>
<overlay>
<!-- empty groupId/artifactId represents the current build -->
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>

Generating multiple javadoc reports using maven-javadoc-plugin and Maven 3

We use a custom doclet to generate a report from custom javadoc tags, and use the Maven site plugin and javadoc plugin to generate both this report and the regular java API docs.
The section of the POM looks like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<reportSets>
<reportSet>
<id>html</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
<reportSet>
<id>custom_report</id>
<configuration>
...
</configuration>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
Under Maven 2, this works fine, but in Maven 3 only one report is generated, that being the last one specified in the POM (confimed by swapping the reportSet elements).
After some experimenting I discovered that if I changed the regular report's goal from "javadoc" to "test-javadoc", then I got output from both report sets. So the problem seems to be that with Maven 3 I can't generate two reports that use the same javadoc-plugin goal.
Is this a bug, or is there some congifuration I've missed? I moved the maven-javadoc-plugin setup from reporting to the configuration of the site plugin as described at http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html, to no avail. I'm using Maven 3.0.4, maven-site-plugin 3.0-beta-3 and maven-javadoc-plugin 2.8.1.
Thanks!
It's a bug in maven-reporting-exec component.
Report sets are kept in a map using the report goal as a key.

Resources